Here is a Linux commands cheat sheet that includes some of the most common commands used for managing files, directories, processes, users, and networks:
File and Directory Operations:
Command
Description
Syntax
ls
List directory contents
ls [options] [directory]
cd
Change directory
cd [directory]
pwd
Print working directory
pwd
mkdir
Create a new directory
mkdir [options] directory
cp
Copy files and directories
cp [options] source destination
mv
Move or rename files and directories
mv [options] source destination
rm
Remove files and directories
rm [options] file/directory
find
Search for files and directories
find [path] [expression]
Text Manipulation:
Command
Description
Syntax
cat
Concatenate and display file contents
cat [options] file
grep
Search for patterns in files
grep [options] pattern file
head
Display the beginning of a file
head [options] file
tail
Display the end of a file
tail [options] file
wc
Count lines, words, and characters in a file
wc [options] file
sed
Stream editor for text manipulation
sed [options] commands [file]
awk
Pattern scanning and processing language
awk [options] ‘program’ [file]
System Information:
Command
Description
Syntax
uname
Print system information
uname [options]
whoami
Print the current username
whoami
uptime
Display system uptime
uptime
top
Display system processes and resource usage
top
free
Display system memory usage
free
df
Display disk space usage
df [options] [file/system]
du
Estimate file and directory space usage
du [options] [file/directory]
File Permissions:
Command
Description
Syntax
chmod
Change file permissions
chmod [options] mode file
chown
Change file ownership
chown [options] owner[:group] file
chgrp
Change group ownership
chgrp [options] group file
umask
Set default file permissions
umask [options] mode
Process Management:
Command
Description
Syntax
ps
Display process status
ps [options]
kill
Terminate a process
kill [options] process_ID
bg
Put a process in the background
bg [options] [job_spec]
fg
Bring a process to the foreground
fg [options] [job_spec]
nohup
Run a command that persists after session ends
nohup command [options]
Network:
Command
Description
Syntax
ifconfig
Display or configure network interfaces
ifconfig [interface] [options]
ping
Test network connectivity
ping [options] host
ssh
Secure shell remote login
ssh [options] [user@]hostname
scp
Securely copy files between hosts
scp [options] source_file [user@]host:destination
netstat
Network statistics and connections
netstat [options]
curl
Transfer data from or to a server
curl [options] URL
wget
Download files from the web
wget [options] URL
Package Management:
Command
Description
Syntax
apt-get
Package handling utility (Debian-based systems)
yum
Package manager (RHEL-based systems)
pacman
Package manager (Arch Linux)
Compression and Archiving:
Command
Description
Syntax
tar
Archive files
tar [options] [archive] [files/directories]
gzip
Compress files
gzip [options] file
unzip
Extract files from a ZIP archive
unzip [options] file.zip
unrar
Extract files from a RAR archive
unrar [options] archive.rar
Please note that this is just a basic cheat sheet, and there are many more Linux commands and options available. For more detailed information on each command, refer to the respective command’s manual pages using the “man” command (e.g., “man ls” for the ls command).
Feel free to explore and experiment with these commands to enhance your Linux command-line skills!