This cheat sheet covers essential Linux commands — from basic navigation to file management and networking tools.
ls
: List files and directoriesls -l # displays files and directories with detailed information ls -a # shows all files and directories, including hidden ones ls -lh # displays file sizes in a human-readable format
cd
: Change directorycd /path/to/directory # changes the current directory to the specified path
pwd
: Print current working directorypwd # displays the current working directory
mkdir
: Create a new directorymkdir new_folder
rm
: Remove directory or filesrm -r folder_name # deletes the directory and its contents
mv
: Move or rename filesmv oldname.txt newname.txt mv file.txt /path/to/destination/
cp
: Copy files and directoriescp file.txt copy.txt cp -r folder/ /destination/
cat
: View file contentcat file.txt
head
: View the first few lines of a filehead file.txt
tail
: View the last few lines of a filetail file.txt
ln
: Create file linksln -s original.txt linkname.txt # creates a symbolic link
find
: Search for files or directoriesfind . -name "*.txt" # search for all .txt files in current directory
chmod
: Change file permissionschmod 755 script.sh
tar
: Create or extract archive filestar -cvf archive.tar folder/ # create tar -xvf archive.tar # extract
gzip
: Compress filesgzip file.txt
zip
: Create compressed zip archiveszip archive.zip file1 file2
ssh
: Securely connect to a remote serverssh user@hostname
scp
: Securely copy files between hostsscp file.txt user@hostname:/path/to/destination
wget
: Download files from the webwget http://example.com/file.txt