to start any service in linux there have 2 ways service
and systemctl
:
$ sudo service SERVICENAME start [service name like httpd,mySQL etc]
$ sudo systemctl start SERVICENAME
Enter fullscreen mode
Exit fullscreen mode
to stop any service in linux :
$ sudo service SERVICENAME stop
# sudo systemctl stop SERVICENAME
Enter fullscreen mode
Exit fullscreen mode
restart any stop service again :
$ sudo service SERVICENAME restart
$ sudo systemctl restart SERVICENAME
Enter fullscreen mode
Exit fullscreen mode
to check any service up and running or not :
$ sudo service SERVICENAME status
$ sudo systemctl status SERVICENAME
$ sudo systemctl is-active SERVICENAME
$ sudo systemctl show SERVICENAME
Enter fullscreen mode
Exit fullscreen mode
here is all download related linux command :
install some software we use apt
and yum
here all yum command for RPM like centOS, alpine etc
:
$ sudo apt install AppName
$ sudo yum install appName
Enter fullscreen mode
Exit fullscreen mode
remove any app from your local linux machine :
$ sudo apt remove appName
$ sudo yum erase appName
Enter fullscreen mode
Exit fullscreen mode
get update and upgrade:
$ sudo apt update
$ sudo apt upgrade
$ sudo yum update
Enter fullscreen mode
Exit fullscreen mode
get any install package info:
$ sudo apt show appName
$ sudo yum info appName
Enter fullscreen mode
Exit fullscreen mode
download something from remote server or internet we use curl
and wget
:
$ curl downloadLink [curl https://www.baeldung.com/] {curl show output in console}
$ wget downloadLink [wget https://www.baeldung.com/] {wget download it into a file}
Enter fullscreen mode
Exit fullscreen mode
to compress a file in linux by .gz extention:
$ gzip myCompressFile
Enter fullscreen mode
Exit fullscreen mode
to decompress a file in linux from .gz extended file:
$ gunzip myfileName.gz
Enter fullscreen mode
Exit fullscreen mode
tar file with .tar extention :
$ tar cvf mytarFile.tar myDestinyFile [here cvf's c stand for create]
$ tar xvf mytarFile.tar [here xvf's x stand for extract]
Enter fullscreen mode
Exit fullscreen mode
dpkg and rpm:
$ dpkg -i some_deb_ubuntu_package.deb [for install debian and ubuntu package file]
$ rpm -i some_centOs_alpine_rpm_package.rpm [for install redhat package file]
$ dpkg -r some_deb_ubuntu_package.deb [remove file]
$ rpm -e some_centOs_alpine_rpm_package.rpm [remove file]
Enter fullscreen mode
Exit fullscreen mode
list install packages in ubuntu debian and redhat:
$ dpkg -l [for ubuntu and debian]
$ rpm -qa [for red hat centOS,alpine ]
Enter fullscreen mode
Exit fullscreen mode
Top comments (0)