Linux Commands Cheat Sheet in Black & White - 2 PDF
Linux Commands Cheat Sheet in Black & White - 2 PDF
Linux Commands Cheat Sheet in Black & White - 2 PDF
Command are categorized into different sections according to its usage. We have
designed the command in white color with black background as we often use on
Linux shell. We have added bit color for attraction.
We have grouped Linux commands in the below sections for better understanding.
1 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
If you are looking to print Linux commands cheat sheet in A4 size paper
(https://images.linoxide.com/linux-commands-cheat-sheet-A4.pdf) its available for
download.
1) System
uname Displays Linux system information
uptime Displays how long the system has been running including load average
finger
Displays information about the user
username
2 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
2) Hardware
dmesg Displays bootup messages
cat Displays more information about CPU e.g model, model name, cores,
/proc/cpuinfo vendor id
cat Displays more information about hardware memory e.g. Total and
/proc/meminfo Free memory
Displays free and used memory in the system (-m flag indicates
free -m
memory in MB)
hdparm -i
Displays information about disk data
/dev/xda
hdparm -tT
Conducts a read speed test on device xda
/dev/xda <:code>
badblocks -s
Tests for unreadable blocks on disk
/dev/xda
3) Users
3 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
id Displays the details of the active user e.g. uid, gid, and groups
groupadd
Adds the group 'admin'
"admin"
4) File Commands
ls -al Lists files - both regular & hidden files and their permissions as well.
mkdir
Creates a new directory
'directory_name'
rm -r
Removes a directory recursively
directory_name
rm -rf
Removes a directory forcefully and recursively
directory_name
4 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
cp -r dir1 dir2 Recursively Copies dir1 to dir2. dir2 is created if it does not exist
ln -s /path/to
/file_name Creates a symbolic link to file_name
link_name
gpg
Decrypts a file
file_name.gpg
5) Process Related
ps Display currently active processes
5 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
6) File Permission
chmod octal filename
Change file permissions of the file to octal
Example
chmod 777 Set rwx permissions to owner, group and everyone (everyone
/data/test.c else who has access to the server)
6 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
chmod 755
Set rwx to the owner and r_x to group and everyone
/data/test.c
chmod 766
Sets rwx for owner, rw for group and everyone
/data/test.c
chown owner-
user:owner-group Change owner and group owner of the file
file_name
chown owner-
user:owner-group Change owner and group owner of the directory
directory
7) Network
ip addr show Displays IP addresses and all the network interfaces
ip address add
192.168.0.1/24 dev Assigns IP address 192.168.0.1 to interface eth0
eth0
7 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
8) Compression/Archives
tar -cf home.tar
Creates archive file called 'home.tar' from file 'home'
home<:code>
9) Install Packages
rpm -i pkg_name.rpm
Install an rpm package
rpm -e pkg_name
Removes an rpm package
8 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
11) Search
grep 'pattern' files
Search for a given pattern in files
locate file
Find all instances of the file
find /home/ -name "index" Find file names that begin with 'index' in /home
folder
find /home -size +10000k Find files greater than 10000k in the home folder
12) Login
9 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
ssh user@host
Securely connect to host as user
ssh -p port_number
Securely connect to host using a specified port
user@host
13) File Transfer
scp file1.txt server2/tmp
Securely copy file1.txt to server2 in /tmp directory
14) Disk Usage
df -h Displays free space on mounted systems
10 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
Read Also:
38 Basic Linux Commands to Learn with Examples (https://linoxide.com/linux-command
/essential-linux-basic-commands/)
A Brief Outline of 106 Linux Commands with Examples (https://linoxide.com/linux-how-
to/linux-commands-brief-outline-examples/)
Comments
11 of 12 4/26/19, 10:06 AM
Linux Cheat Sheet Commands - PDF Download & ... https://linoxide.com/linux-command/linux-comma...
Your email address will not be published. Required fields are marked *
Name * Email *
12 of 12 4/26/19, 10:06 AM