🐧 Linux Commands You’ll Use Every Day

Pranav SavaniPranav Savani
3 min read

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.


0
Subscribe to my newsletter

Read articles from Pranav Savani directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pranav Savani
Pranav Savani