Show Menu
Cheatography

Cheatsheet Including Linux and Git Commands

File and Directory Manage­ment

ls
List files and direct­ories.
cd
Change the current directory.
pwd
Print the working directory.
touch
Create an empty file.
mkdir
Create a new directory.
rm
Remove files or direct­ories.
cp
Copy files or direct­ories.
mv
Move or rename files or direct­ories.

Package Management

apt / apt-get
Package management for Debian­-based systems.
yum
Package management for Red Hat-based systems.
dnf
Package management for Fedora and CentOS.
zypper
Package management for openSUSE.

File Compre­ssion and Archiving

tar
Archive files.
gzip / gunzip
Compress or decompress files.
zip / unzip
Create or extract zip archives.
bzip2 / bunzip2
Compress or decompress files with bzip2.
xz / unxz
Compress or decompress files with xz.

Process Management

ps
Display currently running processes.
kill
Terminate processes.
top
Monitor system processes in real-time.
ps aux
Show detailed process inform­ation.
killall
Terminate processes by name.

File Permis­sions

chmod
Change file permis­sions.
chown
Change file owner and group.
umask
Set default file permis­sions for new files.
chgrp
Change group ownership of a file or directory.
lsattr
List file attrib­utes.

Miscel­laneous

date
Display or set the system date and time.
history
View command history.
man
Display the manual pages for commands.
cal
Display a calendar.
who
Show who is logged on.
uptime
Show system uptime.
watch
Execute a command repeatedly and display results.
 

File Viewing and Editing

cat
Concat­enate and display file contents.
more / less
View file contents one page at a time.
nano / vim / emacs
Text editors for file editing.
head
Display the beginning of a file.
tail
Display the end of a file.
wc
Count lines, words, and characters in a file.
sed
Stream editor for text manipu­lation.

Networking

ping
Check network connec­tivity to a host.
ifconfig / ip
Network interface config­ura­tion.
ssh
Securely connect to a remote machine.
scp
Securely copy files between machines.
netstat
Network statistics and active connec­tions.
nslookup
Query DNS servers for DNS-re­lated inform­ation.
curl
Transfer data from or to a server.
wget
Download files from the web.

System Inform­ation

uname
Display system inform­ation.
df
Disk space usage.
free
Display memory usage.
uptime
Show system uptime.
lsb_re­lease
Display Linux Standard Base (LSB) inform­ation.
lscpu
Display CPU inform­ation.
lshw
List hardware inform­ation.
lsblk
List block devices.

Text Processing

grep
Search for text in files.
sed
Stream editor for text manipu­lation.
awk
Text processing and pattern matching.
cut
Remove sections from each line of a file.
sort
Sort lines of text files.
tr
Translate characters in a file.
comm
Compare two sorted files line by line.

User Management

useradd / adduser
Create a new user.
passwd
Change user password.
usermod
Modify user account settings.
userdel
Delete a user account.
id
Display user and group inform­ation.
groups
Show group membership for a user.
   
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Git Cheatsheet Cheat Sheet