π§ Linux Commands Youβll Use Every Day

Whether youβre a developer, sysadmin, or cloud engineer, the Linux command line is where the magic happens. In this post, Iβll walk you through 20 practical Linux commands that help you navigate, manage, and troubleshoot your system more effectively, with simple explanations and examples you can copy and paste.
π§ 1. pwd
β Where Am I?
Prints your current directory path.
$ pwd
/home/projects
β Useful when working with deep folder structures.
π 2. cd
β Change Directory
Navigate between folders.
$ cd /var/log
$ cd ~ # go to home
$ cd .. # go one directory up
β A must for moving around file systems.
π 3. ls
β List Files
View files in a folder.
$ ls
$ ls -l # long format
$ ls -a # include hidden files
β Great for checking folder contents at a glance.
π 4. touch
β Create a File
Makes a new empty file.
$ touch notes.txt
β Handy when starting a new config or script file.
π§± 5. mkdir
β Make a Folder
$ mkdir logs
$ mkdir -p projects/webapp # creates parent dirs too
β Used frequently in scripting and setup tasks.
π§Ή 6. rm
β Delete Files or Folders
$ rm oldfile.txt
$ rm -r temp/ # recursively remove folder
β οΈ Be careful! Always double-check before hitting enter.
π€ 7. cp
β Copy Files or Directories
$ cp file.txt backup.txt
$ cp -r folder1/ folder2/
β Used for backups, cloning configs, etc.
π 8. mv
β Move or Rename
$ mv oldname.txt newname.txt
$ mv file.txt /home/user/Documents/
β Rename files or organize project folders.
π 9. cat
β View File Contents
$ cat todo.txt
β Best for quickly viewing small files or config outputs.
π΅οΈββοΈ 10. grep
β Search Inside Files
$ grep "ERROR" logfile.txt
β Perfect for scanning logs or filtering data.
π§ 11. history
β View Recent Commands
$ history
$ !100 # rerun command #100
β Saves time when repeating tasks or debugging.
π 12. find
β Locate Files
$ find . -name "*.log"
β Useful in large codebases or cluttered directories.
π§ͺ 13. chmod
β Change Permissions
$ chmod +x script.sh # make executable
β Common when running shell scripts or working on servers.
πΎ 14. df -h
β Check Disk Space
$ df -h
β Helps avoid βNo space left on deviceβ errors!
π 15. top
/ htop
β Monitor System Usage
$ top
$ htop # install with sudo apt install htop
β See CPU, memory, and process info in real-time.
π‘ 16. ping
β Test Network
$ ping google.com
β Basic but essential for checking connectivity issues.
ποΈ 17. tail
β View the End of a File
$ tail -n 20 /var/log/syslog
$ tail -f /var/log/nginx/error.log # live output
β Very helpful for real-time monitoring of logs.
π¦ 18. sudo
β Run As Admin
$ sudo apt update
β Prefix for most system-level changes.
π οΈ 19. apt
β Install and Update Packages
$ sudo apt install curl
$ sudo apt update && sudo apt upgrade
β Keep your system up to date and install tools easily.
π§ββοΈ 20. clear
β Clear Terminal Screen
$ clear
β Clean view when your screen gets cluttered.
π Wrap-Up
These commands form the core toolkit of every Linux user β whether you're managing cloud infrastructure, deploying apps, or writing automation scripts. Mastering these will speed up your workflow and make you more efficient at the terminal.
Subscribe to my newsletter
Read articles from Pranav Savani directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
