The Ultimate Handbook of Linux command cheat sheet

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.

Join 50 other followers

Table of Content

  1. Prerequisites
  2. Linux command cheat sheet
  3. Conclusion

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
Linux uptime command execution
Linux uptime command execution
  • uname command in linux: uname command in linux provides the information about the current kernel of your linux machine.
uname
uname command in Linux execution
uname command in Linux execution
PurposeCommand to execute
System uptime informationuptime
kernel informationuname -r 
The IP address of the machinehostname -I
last rebootlast reboot
Who you are logged in aswhoami
who is onlinew or who
CPU informationcat /proc/cpuinfo
Memory Informationcat /proc/meminfo
free and used memory free -h
hardware infodmidecode
Processestop
List files opened by the userlsof -u user
all the currently running processesps -ef
your currently running processesps
mysql processps –ef | grep mysql
Date & Time Settingschronyd
Date & Time Settingsntpd
Displaying the Current Date and Timedate
Displaying the Current Date and Timetimedatectl
Command to manage systemdsystemctl
System-wide locale settings/etc/locale.conf
Listing available system locale settings:localectl list-locales
current status of the system locales settingslocalectl status
configuring network accessnmcli
configuring network accessnmtui
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 areRPM packages
Repo Directory/etc/yum.repos.d/
available repositories:subscription-manager repos –list
currently enabled repositories:yum repolist
Searching for packagesyum search string
Installing a package:yum install package_name
Updating all packagesyum update
Updating a package:yum update package_name
Uninstalling a packageyum remove package_name
installed and available packagesyum list all
installed packages:yum list installed
enable a servicesystemctl enable service_name
disable a servicesystemctl disable service_name
Firewall service firewalld
current status of the firewallsystemctl status firewalld
Start firewallsystemctl start firewalld
the additional layer of system securitySELinux
Display the current SELinuxgetenforce
Change the state of SELinuxsetenforce Enforcing/Permissive
Permanent SELinux State/etc/selinux/config
SSH connectionfacilitates client-server communication
Disabling SSH Root Loginvi /etc/ssh/sshd_config
PermitRootLogin no
systemctl restart sshd
Min value in useraddUID_MIN 1000
Max value in useraddUID_MAX 60000
Adding a user to a group:usermod -a -G group_name user_name
<1000Reserved userID details in/etc/login.defs
Brilliant Guide to Linux command line sheet

Join 50 other followers

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.

Advertisement