Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Linux Cheat Sheet

by Sky11 via cheatography.com/190795/cs/39698/

File and Directory Manage​ment Miscel​laneous

ls List files and direct​ories. date Display or set the system date and time.
cd Change the current directory. history View command history.
pwd Print the working directory. man Display the manual pages for commands.

touch Create an empty file. cal Display a calendar.


mkdir Create a new directory. who Show who is logged on.
rm Remove files or direct​ories. uptime Show system uptime.
cp Copy files or direct​ories. watch Execute a command repeatedly and display results.
mv Move or rename files or direct​ories.
File Viewing and Editing
Package Management cat Concat​enate and display file contents.
apt / apt-get Package management for Debian​-based systems. more / less View file contents one page at a time.

yum Package management for Red Hat-based systems. nano / vim / emacs Text editors for file editing.
dnf Package management for Fedora and CentOS. head Display the beginning of a file.
zypper Package management for openSUSE. tail Display the end of a file.
wc Count lines, words, and characters in a file.
File Compre​ssion and Archiving
sed Stream editor for text manipu​lation.
tar Archive files.
gzip / gunzip Compress or decompress files. Networking

zip / unzip Create or extract zip archives. ping Check network connec​tivity to a host.
bzip2 / bunzip2 Compress or decompress files with bzip2. ifconfig / ip Network interface config​ura​tion.
xz / unxz Compress or decompress files with xz. ssh Securely connect to a remote machine.
scp Securely copy files between machines.
Process Management
netstat Network statistics and active connec​tions.
ps Display currently running processes.
nslookup Query DNS servers for DNS-re​lated inform​ation.
kill Terminate processes.
curl Transfer data from or to a server.
top Monitor system processes in real-time.
wget Download files from the web.
ps aux Show detailed process inform​ation.

killall Terminate processes by name. System Inform​ation

uname Display system inform​ation.


File Permis​sions
df Disk space usage.
chmod Change file permis​sions.
free Display memory usage.
chown Change file owner and group.
uptime Show system uptime.
umask Set default file permis​sions for new files.
lsb_re​lease Display Linux Standard Base (LSB) inform​ation.
chgrp Change group ownership of a file or directory.
lscpu Display CPU inform​ation.
lsattr List file attrib​utes.
lshw List hardware inform​ation.
lsblk List block devices.

By Sky11 Published 27th July, 2023. Sponsored by CrosswordCheats.com


cheatography.com/sky11/ Last updated 27th July, 2023. Learn to solve cryptic crosswords!
Page 1 of 2. http://crosswordcheats.com
Linux Cheat Sheet
by Sky11 via cheatography.com/190795/cs/39698/

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.

By Sky11 Published 27th July, 2023. Sponsored by CrosswordCheats.com


cheatography.com/sky11/ Last updated 27th July, 2023. Learn to solve cryptic crosswords!
Page 2 of 2. http://crosswordcheats.com

You might also like