Free Converter
Linux / Bash Command Cheat Sheet
Comprehensive Linux and Bash command cheat sheet. Search 80+ essential commands with examples, descriptions, and one-click copy.
ls
List directory contents
Example:
ls -la /home/userls -la
List all files including hidden, with details
Example:
ls -la ~/Documentscd
Change directory
Example:
cd /var/logpwd
Print working directory path
Example:
pwdmkdir
Create a new directory
Example:
mkdir -p /tmp/mydir/subdirrm
Remove files or directories
Example:
rm -rf /tmp/oldfilescp
Copy files or directories
Example:
cp -r /src/dir /dst/dirmv
Move or rename files/directories
Example:
mv oldname.txt newname.txttouch
Create an empty file or update timestamp
Example:
touch newfile.txtfind
Search for files in a directory hierarchy
Example:
find /home -name '*.log' -mtime -7locate
Find files by name using a prebuilt database
Example:
locate nginx.confln
Create hard or symbolic links
Example:
ln -s /path/to/target /path/to/linkdf
Report disk space usage of file systems
Example:
df -hdu
Estimate file space usage
Example:
du -sh /var/log/*stat
Display file or file system status
Example:
stat /etc/passwdfile
Determine file type
Example:
file /usr/bin/bashcat
Concatenate and display file contents
Example:
cat /etc/hostsless
View file content one screen at a time
Example:
less /var/log/syslogmore
View file content page by page
Example:
more /etc/passwdhead
Output the first part of a file
Example:
head -n 20 /var/log/auth.logtail
Output the last part of a file
Example:
tail -f /var/log/sysloggrep
Search text using patterns
Example:
grep -rn 'error' /var/log/sed
Stream editor for filtering and transforming text
Example:
sed 's/old/new/g' file.txtawk
Pattern scanning and text processing language
Example:
awk '{print $1, $3}' access.logsort
Sort lines of text files
Example:
sort -k2 -n data.txtuniq
Report or omit repeated lines
Example:
sort file.txt | uniq -cwc
Print newline, word, and byte counts
Example:
wc -l /etc/passwdcut
Remove sections from each line of files
Example:
cut -d: -f1 /etc/passwdtr
Translate or delete characters
Example:
echo 'hello' | tr 'a-z' 'A-Z'echo
Display a line of text
Example:
echo "Hello, World!"printf
Format and print data
Example:
printf "%s\t%d\n" name 42diff
Compare files line by line
Example:
diff file1.txt file2.txttee
Read from stdin and write to stdout and files
Example:
ls | tee output.txtps
Report a snapshot of current processes
Example:
ps aux | grep nginxtop
Display Linux processes in real time
Example:
top -u www-datahtop
Interactive process viewer (ncurses-based)
Example:
htopkill
Send a signal to a process
Example:
kill -9 1234killall
Kill processes by name
Example:
killall firefoxbg
Resume a suspended job in the background
Example:
bg %1fg
Bring a job to the foreground
Example:
fg %1jobs
List active jobs in the current shell
Example:
jobs -lnohup
Run a command immune to hangups
Example:
nohup ./script.sh &nice
Run a command with modified scheduling priority
Example:
nice -n 10 ./heavy_task.shsystemctl
Control the systemd system and service manager
Example:
systemctl restart nginxservice
Run a System V init script
Example:
service apache2 statusping
Send ICMP ECHO_REQUEST to network hosts
Example:
ping -c 4 google.comcurl
Transfer data from or to a server
Example:
curl -L -o file.zip https://example.com/file.zipwget
Non-interactive network downloader
Example:
wget -q https://example.com/file.tar.gzssh
OpenSSH remote login client
Example:
ssh -i ~/.ssh/key.pem user@hostscp
Secure copy files between hosts
Example:
scp user@host:/path/file.txt ./local/rsync
Remote file copying tool with delta transfer
Example:
rsync -avz /src/ user@host:/dst/netstat
Print network connections and routing tables
Example:
netstat -tulpnss
Utility to investigate sockets
Example:
ss -tulwnifconfig
Configure a network interface
Example:
ifconfig eth0ip
Show and manipulate routing, devices, and tunnels
Example:
ip addr shownmap
Network exploration tool and port scanner
Example:
nmap -sV 192.168.1.0/24dig
DNS lookup utility
Example:
dig +short A google.comnslookup
Query Internet name servers interactively
Example:
nslookup example.comchmod
Change file mode bits (permissions)
Example:
chmod 755 script.shchown
Change file owner and group
Example:
chown -R www-data:www-data /var/wwwchgrp
Change group ownership
Example:
chgrp developers project/sudo
Execute a command as another user (superuser)
Example:
sudo systemctl restart nginxsu
Change user ID or become superuser
Example:
su - postgrespasswd
Change user password
Example:
passwd usernameumask
Set or display the file mode creation mask
Example:
umask 022id
Print user and group information
Example:
id usernamewhoami
Print the current effective user name
Example:
whoamigroups
Print the groups a user is in
Example:
groups usernametar
Archive files using tape archive format
Example:
tar -czvf archive.tar.gz /path/to/dirtar -x
Extract files from a tar archive
Example:
tar -xzvf archive.tar.gz -C /target/gzip
Compress files using GNU zip
Example:
gzip -9 large_file.loggunzip
Decompress gzip compressed files
Example:
gunzip archive.tar.gzzip
Package and compress files into a ZIP archive
Example:
zip -r output.zip /path/to/dirunzip
Extract files from a ZIP archive
Example:
unzip archive.zip -d /target/bzip2
Compress files using bzip2 algorithm
Example:
bzip2 -z large_file.txtxz
Compress files using the XZ algorithm
Example:
xz -z -9 file.txtuname
Print system information
Example:
uname -auptime
Tell how long the system has been running
Example:
uptimefree
Display amount of free and used memory
Example:
free -hlscpu
Display information about the CPU architecture
Example:
lscpulsblk
List information about block devices
Example:
lsblk -o NAME,SIZE,TYPE,MOUNTPOINTlspci
List all PCI devices
Example:
lspci -v | grep VGAdmesg
Print or control the kernel ring buffer
Example:
dmesg | tail -50journalctl
Query and display messages from the journal
Example:
journalctl -u nginx --since '1 hour ago'history
Display the command history list
Example:
history | grep dockerenv
Print environment variables
Example:
env | grep PATHif / then / fi
Conditional execution in shell scripts
Example:
if [ -f file.txt ]; then echo exists; fifor
Loop over a list of items
Example:
for i in 1 2 3; do echo $i; donewhile
Execute commands while a condition is true
Example:
while read line; do echo $line; done < filecase
Multi-branch conditional matching pattern
Example:
case "$var" in a) echo A;; b) echo B;; esacfunction
Define a shell function
Example:
greet() { echo "Hello, $1!"; }; greet Worldexport
Set environment variables for child processes
Example:
export MY_VAR=valuesource
Execute commands from a file in current shell
Example:
source ~/.bashrcalias
Create an alias for a command
Example:
alias ll='ls -la'cron / crontab
Schedule commands to run periodically
Example:
crontab -e # 0 * * * * /path/to/script.shat
Execute commands at a specified time
Example:
echo 'ls /tmp' | at 14:30Related Tools
View all toolsGit Commands Cheat Sheet
Comprehensive Git command cheat sheet. Search 80+ essential Git commands with examples, descriptions, and one-click copy.
Docker Commands Cheat Sheet
Comprehensive Docker command cheat sheet. Search 70+ essential Docker commands with examples, descriptions, and one-click copy.
Vim Commands Cheat Sheet
Comprehensive Vim command cheat sheet. Search 80+ essential Vim commands with examples, descriptions, and one-click copy.
SQL Query Formatter & Highlighter
Format, beautify, and syntax-highlight SQL queries instantly in your browser. Free, secure, and no upload required.