Whether you're a backend dev, frontend dev, or DevOps enthusiast β knowing your way around Linux will supercharge your workflow.
In this blog, Iβve curated 20+ essential Linux commands every developer should know, plus a quick Ubuntu cleanup cheat sheet to keep your system fast and smooth. Let's dive in! π
Hereβs a list of 20+ Linux commands that can make your life easier as a developer.
β pwd β Print Working Directory (Shows the full path of your current directory).
pwd
β ls β List Directory Contents (Lists all files and folders in the current directory).
ls
ls -l # Detailed list
ls -a # Include hidden files
β cd β Change Directory (Move between folders).
cd /path/to/folder
cd ~ # Go to home directory
cd .. # Go one level up
β touch β Create a File (Quickly create an empty file).
touch myfile.txt
β mkdir β Make Directory (Create a new folder).
mkdir myfolder
β rm β Remove Files or Folders (Deletes files or directories carefully).
rm myfile.txt
rm -r myfolder # Delete folder recursively
β cp β Copy Files and Folders (Copies files or entire directories).
cp source.txt destination.txt
cp -r src_folder/ dest_folder/
β mv β Move or Rename Files (Move or rename files and directories).
mv oldname.txt newname.txt
mv file.txt /path/to/new/folder/
β cat β View File Contents (Prints the contents of a file to the terminal).
cat myfile.txt
β nano or vim β Edit Files from Terminal (Simple terminal-based text editors).
nano myfile.txt
vim myfile.txt
β nano or vim β Edit Files from Terminal (Simple terminal-based text editors).
nano myfile.txt
vim myfile.txt
β grep β Search Text Inside Files (Find specific words or patterns inside files).
grep "keyword" filename.txt
grep -r "functionName" src/
β find β Find Files and Directories (Search for files across the system).
find /path/to/search -name "filename.txt"
β chmod β Change File Permissions (Manage who can read, write, or execute files).
chmod +x script.sh # Make script executable
β ps β Check Running Processes (See what processes are running).
ps aux
β kill β Kill a Process (Force-stop a running process using its PID (Process ID)).
kill PID
kill -9 PID # Force kill
β top or htop β Monitor System Usage (Real-time view of CPU, memory usage, and processes).
htop # (if installed, more visual)
β tar β Archive and Extract Files (Compress and extract .tar.gz or .tar files).
tar -czvf archive.tar.gz folder/
tar -xzvf archive.tar.gz
β curl β Transfer Data from URLs (Make API requests or download files).
curl https://api.example.com/data
β wget β Download Files (Download a file directly from the internet).
wget https://example.com/file.zip
β history β See Command History (See the list of commands you've run previously).
history
π Bonus: Ubuntu Clean and Update Commands Cheat Sheet
Keep your Ubuntu machine clean and updated with these quick commands:
π Clean Temporary Files
sudo apt autoremove
sudo apt clean
π Update System
sudo apt update && sudo apt upgrade
Final Thoughts
These Linux commands are like superpowers for developers.
Mastering them saves you time, makes you faster, and brings you closer to truly understanding how your system works under the hood.
If you're new to Linux, pick 3β5 commands first, use them daily, and slowly grow your command-line fluency.
π¬ Over to You!
Whatβs your favorite Linux command?
Drop it in the comments below β letβs build the ultimate developer terminal toolkit together! πͺ
Top comments (2)
The
touch
command is actually for updating the timestamps of files. The fact that it creates the file if it doesn't already exist is merely a convenient side effect.It's quicker and easier to just use this to create a new, empty file:
Thank-you