DEV Community

Cover image for Essential Linux Commands Every Developer Should Master
Gaurav Dalvi
Gaurav Dalvi

Posted on • Originally published at blog.gauravdalvi.com

2 1

Essential Linux Commands Every Developer Should Master

Let’s face it: if you're writing code and not using Linux (or at least the terminal), you’re missing out on half the developer experience — the half where you actually feel like a hacker from a ‘90s movie.

Whether you’re deploying, debugging, or just flexing in front of your coworkers, these Linux commands are essential tools in your utility belt.


🧠 pwd — Print Working Directory

Translation: “Where the heck am I?”

pwd
Enter fullscreen mode Exit fullscreen mode

This one tells you your current location in the filesystem jungle. Like GPS, but for your terminal.


📂 ls — List Directory Contents

Translation: “Show me what’s in this folder.”

ls
ls -la
Enter fullscreen mode Exit fullscreen mode

Add -l for detailed info and -a to uncover hidden treasures (.env, .git, .Iforgotaboutthis).


🚪 cd — Change Directory

Translation: “Get me out of here.”

cd /path/to/destination
cd ~  # Go to home
cd -  # Go back
Enter fullscreen mode Exit fullscreen mode

Essential for moving around like a pro instead of exiting the terminal and opening File Explorer like a peasant.


🔥 rm — Remove Files or Directories

Translation: “Delete like you mean it.”

rm file.txt
rm -r folder/
rm -rf /  # Don’t. Ever.
Enter fullscreen mode Exit fullscreen mode

The -r flag removes folders recursively. -f makes it ruthless. Combining both is like giving your terminal a bazooka.


🧹 mkdir & rmdir — Make / Remove Directory

mkdir new_folder
rmdir old_folder
Enter fullscreen mode Exit fullscreen mode

Simple yet essential. mkdir -p even creates nested directories like a boss:

mkdir -p projects/nextjs/my-awesome-app
Enter fullscreen mode Exit fullscreen mode

📝 touch — Create an Empty File

touch newfile.txt
Enter fullscreen mode Exit fullscreen mode

No need to open VS Code just to create a file. touch and go!


🔍 grep — Search Through Files

Translation: “Ctrl + F for the terminal.”

grep 'TODO' *.js
Enter fullscreen mode Exit fullscreen mode

Search for specific text patterns. Super useful when your codebase has more bugs than features.


🪓 chmod — Change File Permissions

chmod +x script.sh
Enter fullscreen mode Exit fullscreen mode

Grants execution rights. Because not all heroes wear capes; some just need the right permissions.


🏃 ./ — Run Executables

./myscript.sh
Enter fullscreen mode Exit fullscreen mode

If you wrote a script but the terminal says “permission denied,” check your chmod (see above). Once executable, this is how you run it.


🦸 sudo — SuperUser Do

Translation: “I know what I’m doing... probably.”

sudo apt-get update
Enter fullscreen mode Exit fullscreen mode

Gives you superpowers. Use wisely, or you might brick your OS and end up spending the weekend reinstalling Linux.


🌐 curl — Transfer Data from URLs

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

Download files, test APIs, or pretend you're working on your terminal when you're actually sending cat GIFs.


💣 kill & killall — Stop Processes

kill <PID>
killall node
Enter fullscreen mode Exit fullscreen mode

When Ctrl + C just isn’t enough, kill is the polite way to ask processes to die. killall... well, does what the name says.


🧪 top / htop — Monitor Processes

top
htop
Enter fullscreen mode Exit fullscreen mode

Real-time view of CPU and memory usage. htop is the cool, colorful cousin of top. Install it, thank me later.


📦 tar — Archive and Extract Files

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

Because zipping and unzipping files shouldn’t require dragging anything.


🧾 man — Manual Pages

man ls
Enter fullscreen mode Exit fullscreen mode

Lost? Confused? Broken? Type man + command and let the terminal's ancient wisdom guide you.


💡 Final Thoughts

Learning Linux commands is like learning to cook. At first, you’ll burn a lot of files (rm -rf) and confuse cd with mkdir, but once you’re comfortable, you’ll be able to whip up deployments, debug servers, and automate tasks like a chef plating Michelin-star code.

So, stop Googling “How to delete file Linux” and start memorizing the essentials.

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

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

Join the Runner H "AI Agent Prompting" Challenge: $10,000 in Prizes for 20 Winners!

Runner H is the AI agent you can delegate all your boring and repetitive tasks to - an autonomous agent that can use any tools you give it and complete full tasks from a single prompt.

Check out the challenge

DEV is bringing live events to the community. Dismiss if you're not interested. ❤️