If you are new to Linux operating system, then this handbook is a Linux command cheat sheet for you that will help you to jumpstart in the Linux world.
In this ultimate Handbook of Linux command cheat sheet, you will find a variety of Linux command that you are used every day in the Linux administrator role.
Table of Content
Prerequisites
This post will be a step-by-step tutorial. If you’d like to follow along, be sure you have:
- CentOS 8 machine or preferably CentOS 7 plus , if you don’t have any machine you can create a ec2 instance on AWS account. Recommended to have 4GB RAM and at least 5GB of drive space.
how to check linux version or the kernel version : You can use uname –kernel-name –kernel-release –machine command
Linux command cheat sheet
In this section, you will see the Linux command, and they are executed. You should try these commands on your centos machine which will help you to command linux operating system.
- Linux uptime command: Linux uptime command provides the details about how long the Linux system is active and running.
uptime

- uname command in linux: uname command in linux provides the information about the current kernel of your linux machine.
uname

Purpose | Command to execute |
---|---|
System uptime information | uptime |
kernel information | uname -r |
The IP address of the machine | hostname -I |
last reboot | last reboot |
Who you are logged in as | whoami |
who is online | w or who |
CPU information | cat /proc/cpuinfo |
Memory Information | cat /proc/meminfo |
free and used memory | free -h |
hardware info | dmidecode |
Processes | top |
List files opened by the user | lsof -u user |
all the currently running processes | ps -ef |
your currently running processes | ps |
mysql process | ps –ef | grep mysql |
Date & Time Settings | chronyd |
Date & Time Settings | ntpd |
Displaying the Current Date and Time | date |
Displaying the Current Date and Time | timedatectl |
Command to manage systemd | systemctl |
System-wide locale settings | /etc/locale.conf |
Listing available system locale settings: | localectl list-locales |
current status of the system locales settings | localectl status |
configuring network access | nmcli |
configuring network access | nmtui |
modify the existing connection: | nmcli con mod “con-name” |
display all connections: | nmcli con show |
display the active connection: | nmcli con show –active |
Linux Softwares are | RPM packages |
Repo Directory | /etc/yum.repos.d/ |
available repositories: | subscription-manager repos –list |
currently enabled repositories: | yum repolist |
Searching for packages | yum search string |
Installing a package: | yum install package_name |
Updating all packages | yum update |
Updating a package: | yum update package_name |
Uninstalling a package | yum remove package_name |
installed and available packages | yum list all |
installed packages: | yum list installed |
enable a service | systemctl enable service_name |
disable a service | systemctl disable service_name |
Firewall service | firewalld |
current status of the firewall | systemctl status firewalld |
Start firewall | systemctl start firewalld |
the additional layer of system security | SELinux |
Display the current SELinux | getenforce |
Change the state of SELinux | setenforce Enforcing/Permissive |
Permanent SELinux State | /etc/selinux/config |
SSH connection | facilitates client-server communication |
Disabling SSH Root Login | vi /etc/ssh/sshd_config PermitRootLogin no systemctl restart sshd |
Min value in useradd | UID_MIN 1000 |
Max value in useradd | UID_MAX 60000 |
Adding a user to a group: | usermod -a -G group_name user_name |
<1000 | Reserved userID details in/etc/login.defs |
Conclusion
In this ultimate Handbook of Linux command cheat sheet, you learned various Linux commands that you can use in the Linux administrator role.
So now you are Linux command pro, so you should consider creating shell scripts with all these commands and try.