Whether you’re a backend engineer, DevOps developer, system administrator, or just someone trying to master the terminal, understanding Linux commands is essential.
These 20 commands are the core tools you will use daily across development, automation, and server management.
Let’s dive in! 🚀
1. pwd — Print Working Directory
Shows the absolute path of your current directory.
pwd
2. ls — List Files
Lists files and directories.
ls
ls -l # long format
ls -a # show hidden files
ls -lh # human-readable sizes
3. cd — Change Directory
Navigate between directories.
cd /path/to/folder
cd ~ # go to home directory
cd .. # go back one directory
4. mkdir — Make Directories
Create new folders.
mkdir project
mkdir -p parent/child/grandchild
5. rm — Remove Files/Folders
Delete files or directories.
rm file.txt
rm -r folder/
rm -rf force_delete/
⚠️ Use -rf with caution!
6. cp — Copy Files/Folders
Copy files or folders.
cp file.txt backup.txt
cp -r project/ project_backup/
7. mv — Move/Rename Files
Move or rename items.
mv a.txt b.txt
mv file.txt /other/location/
8. touch — Create Empty Files
Create new empty files.
touch index.html
9. cat — View File Content
Prints file contents.
cat file.txt
10. less — View Large Files
Scroll file content interactively.
less biglog.log
11. head & tail — View File Start/End
View the beginning or end of files.
head -n 20 file.txt
tail -n 20 file.txt
tail -f app.log # follow live logs
12. grep — Search Text
Search inside files or output.
grep "error" file.log
grep -R "TODO" src/
13. find — Search Files in System
Find files based on name, type, etc.
find . -name "*.js"
find /var -type f -size +10M
14. chmod — Change Permissions
Modify file permissions.
chmod +x script.sh
chmod 755 program
15. chown — Change Ownership
Change file owner and group.
sudo chown user:group file.txt
16. ps — Show Running Processes
Monitor currently running processes.
ps
ps aux | grep python
17. top / htop — System Monitor
Real-time process and resource usage.
top
htop # if installed, nicer UI
18. kill — Terminate Processes
Kill a process by PID.
kill 1234
kill -9 5678 # force kill
19. df — Disk Usage
Check disk space.
df -h
20. du — Directory Size
Check folder sizes.
du -h
du -sh * # show size of each file/folder
🧠 Bonus: Essential Power Commands
Update packages
sudo apt update && sudo apt upgrade
Download from internet
wget https://example.com/file.zip
curl -O https://example.com/file.zip
Edit files
nano file.txt
vim file.txt
🚀 Final Thoughts
Mastering these 20 Linux commands will massively boost your productivity as a developer. They are the foundation for:
- server administration
- DevOps work
- shell scripting
- backend deployment
- debugging
- automation
Top comments (0)