0% found this document useful (0 votes)
84 views

50 Bash Commands Cheat Sheet

50 Bash Commands Cheat Sheet

Uploaded by

Hafijul Amin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views

50 Bash Commands Cheat Sheet

50 Bash Commands Cheat Sheet

Uploaded by

Hafijul Amin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

50 Bash Commands Cheat Sheet

This reference table serves as a quick guide for your Bash-related tasks.

Command Description

ls List directory contents

pwd Print current working directory

cd dir_name Change directory

echo "Hello" Display a message or output

man ls Display manual for a command

mkdir new_dir Create a directory

rmdir new_dir Remove a directory

cat file.txt Display the contents of a file

touch newfile.txt Create a new empty file or update timestamp

rm file.txt Remove a file

cp file1 file2 Copy file1 to file2

mv file1 dir1 Move file1 to dir1 directory

date Display current date and time

cal Display the calendar

df Display disk space usage

du Estimate file and directory space usage

ps Display currently active processes

top
Display dynamic real-time view of running
processes
Command Description

kill 12345 Kill process with PID 12345

bg Lists stopped or background jobs

fg Brings a background job to the foreground

history Display command history

clear Clear the terminal

chmod 755 file Change file permissions

chown user:group file Change file owner and group

find . -name "file.txt" Search for files in directory tree

grep "word" file.txt Search for a word inside a file

wc file.txt Count lines, words, and characters in a file

sort file.txt Sort the lines of a file

cut -d':' -f1 /etc/passwd Cut out sections from each line of files

tar czf archive.tar.gz dir Create a compressed archive of a directory

unzip file.zip Extract files from a zip archive

alias ll='ls -la' Create an alias for a command

uname -a Display system information

ifconfig or ip a Display network interfaces and configurations

ping google.com Ping google.com

netstat -tuln Display network ports and listening services

ssh user@host SSH to a remote host


Command Description

curl www.example.com Fetch the contents of a webpage

wget
www.example.com/file.zip Download a file from the internet

You might also like