DEV Community

Cover image for 🐧20+ Linux Commands for Developers (+Bonus Tips)
Md Afsar Mahmud
Md Afsar Mahmud

Posted on

3

🐧20+ Linux Commands for Developers (+Bonus Tips)

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
Enter fullscreen mode Exit fullscreen mode

● ls β€” List Directory Contents (Lists all files and folders in the current directory).

ls
ls -l     # Detailed list
ls -a     # Include hidden files
Enter fullscreen mode Exit fullscreen mode

● cd β€” Change Directory (Move between folders).

cd /path/to/folder
cd ~       # Go to home directory
cd ..      # Go one level up
Enter fullscreen mode Exit fullscreen mode

● touch β€” Create a File (Quickly create an empty file).

touch myfile.txt
Enter fullscreen mode Exit fullscreen mode

● mkdir β€” Make Directory (Create a new folder).

mkdir myfolder
Enter fullscreen mode Exit fullscreen mode

● rm β€” Remove Files or Folders (Deletes files or directories carefully).

rm myfile.txt
rm -r myfolder   # Delete folder recursively
Enter fullscreen mode Exit fullscreen mode

● cp β€” Copy Files and Folders (Copies files or entire directories).

cp source.txt destination.txt
cp -r src_folder/ dest_folder/
Enter fullscreen mode Exit fullscreen mode

● mv β€” Move or Rename Files (Move or rename files and directories).

mv oldname.txt newname.txt
mv file.txt /path/to/new/folder/
Enter fullscreen mode Exit fullscreen mode

● cat β€” View File Contents (Prints the contents of a file to the terminal).

cat myfile.txt
Enter fullscreen mode Exit fullscreen mode

● nano or vim β€” Edit Files from Terminal (Simple terminal-based text editors).

nano myfile.txt
vim myfile.txt
Enter fullscreen mode Exit fullscreen mode

● nano or vim β€” Edit Files from Terminal (Simple terminal-based text editors).

nano myfile.txt
vim myfile.txt
Enter fullscreen mode Exit fullscreen mode

● grep β€” Search Text Inside Files (Find specific words or patterns inside files).

grep "keyword" filename.txt
grep -r "functionName" src/
Enter fullscreen mode Exit fullscreen mode

● find β€” Find Files and Directories (Search for files across the system).

find /path/to/search -name "filename.txt"
Enter fullscreen mode Exit fullscreen mode

● chmod β€” Change File Permissions (Manage who can read, write, or execute files).

chmod +x script.sh   # Make script executable
Enter fullscreen mode Exit fullscreen mode

● ps β€” Check Running Processes (See what processes are running).

ps aux
Enter fullscreen mode Exit fullscreen mode

● kill β€” Kill a Process (Force-stop a running process using its PID (Process ID)).

kill PID
kill -9 PID    # Force kill
Enter fullscreen mode Exit fullscreen mode

● top or htop β€” Monitor System Usage (Real-time view of CPU, memory usage, and processes).

htop    # (if installed, more visual)
Enter fullscreen mode Exit fullscreen mode

● tar β€” Archive and Extract Files (Compress and extract .tar.gz or .tar files).

tar -czvf archive.tar.gz folder/
tar -xzvf archive.tar.gz
Enter fullscreen mode Exit fullscreen mode

● curl β€” Transfer Data from URLs (Make API requests or download files).

curl https://api.example.com/data
Enter fullscreen mode Exit fullscreen mode

● wget β€” Download Files (Download a file directly from the internet).

wget https://example.com/file.zip
Enter fullscreen mode Exit fullscreen mode

● history β€” See Command History (See the list of commands you've run previously).

history
Enter fullscreen mode Exit fullscreen mode

🎁 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
Enter fullscreen mode Exit fullscreen mode

πŸ“ˆ Update System

sudo apt update && sudo apt upgrade
Enter fullscreen mode Exit fullscreen mode

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! πŸ’ͺ

Postmark Image

20% off for developers shipping features, not fixing email

Build your product without worrying about email infrastructure. Our reliable delivery, detailed analytics, and developer-friendly API let you focus on shipping features that matter.

Start free

Top comments (2)

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ β€’

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:

>filename.txt
Enter fullscreen mode Exit fullscreen mode
Collapse
 
md-afsar-mahmud profile image
Md Afsar Mahmud β€’

Thank-you

Postmark Image

"Please fix this..."

Focus on creating stellar experiences without email headaches. Postmark's reliable API and detailed analytics make your transactional emails as polished as your product.

Start free

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere β€œthank you” often brightens someone’s dayβ€”share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay