Linux Commands

Linux Commands Cheat Sheet

Linux Commands Cheat Sheet

Essential commands for developers and system administrators

This comprehensive cheat sheet covers the most commonly used Linux commands for file management, system administration, networking, and more.

📁

File & Directory Commands

Navigation

pwd
Show current directory
ls
List files
ls -l
List with details
ls -a
Include hidden files
cd foldername
Enter folder
cd ..
Go up one level
cd ~
Go to home directory

Create

touch file
Create empty file
mkdir folder
Create folder
mkdir -p folder/subfolder
Create nested folders

Copy / Move / Rename

cp file dest/
Copy file
cp -r folder dest/
Copy folder
mv oldname newname
Rename or move

Delete

rm file
Delete file
rm -r folder
Delete folder recursively
rm -rf folder
Force delete (no confirmation)
📄

File Content Commands

cat file
View file content
nano file
Edit file with nano editor
head file
Show first 10 lines
tail file
Show last 10 lines
tail -f file
Monitor file changes in real-time
⚙️

System & Info Commands

uname -a
Show system information
whoami
Display current user
df -h
Show disk usage in human-readable format
du -h
Show folder/file sizes
top
Display running processes
htop
Advanced process viewer (if installed)
🛠

Package Management

sudo apt update
Update package repository
sudo apt upgrade
Upgrade installed packages
sudo apt install package
Install a package
sudo apt remove package
Remove a package
sudo apt autoremove
Clean up unused packages
🔐

Permissions

chmod 755 file
Change file permissions
chown user:user file
Change file owner
sudo command
Run command as administrator
🌐

Network

ping google.com
Check network connection
ip a
Show IP addresses
curl url
Fetch data from URL
wget url
Download file from URL
🗜

Compression

tar -cvf file.tar folder/
Create tar archive
tar -xvf file.tar
Extract tar archive
zip file.zip folder/ -r
Create zip archive of folder
unzip file.zip
Extract zip archive

Comments

Popular posts from this blog

Use the Google Custom Search JSON API to retrieve images

Development-Testing Workflow

Terminal commands relared to files in the Ubuntu