DEV Community

Cover image for 19 Linux Commands Every Developer Should Know
Farhad Rahimi Klie
Farhad Rahimi Klie

Posted on

19 Linux Commands Every Developer Should Know

Linux is the backbone of modern software development. From cloud servers and CI/CD pipelines to containers and embedded systems, Linux is everywhere.
If you are a developer, mastering Linux commands is not optional—it is a productivity multiplier.

This article covers 20 essential Linux commands every developer should know, with clear explanations and real-world use cases.


1. ls – List Directory Contents

Displays files and directories.

ls
ls -l
ls -la
Enter fullscreen mode Exit fullscreen mode

Why it matters:
You constantly navigate project folders, logs, and configuration directories.


2. cd – Change Directory

Move between directories.

cd /var/www
cd ..
cd ~
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Navigation speed directly impacts workflow efficiency.


3. pwd – Print Working Directory

Shows your current directory.

pwd
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Prevents mistakes when running destructive commands in the wrong directory.


4. mkdir – Create Directories

Create one or multiple directories.

mkdir project
mkdir -p src/components
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Project scaffolding and clean structure.


5. rm – Remove Files and Directories

Delete files or folders.

rm file.txt
rm -r folder
rm -rf folder
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Used often, but dangerous. Always double-check.


6. cp – Copy Files and Directories

cp file1 file2
cp -r src backup
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Used in builds, backups, and deployments.


7. mv – Move or Rename Files

mv old.txt new.txt
mv file.txt /tmp
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Renaming and restructuring projects.


8. cat – View File Content

Displays file content.

cat file.txt
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Quick inspection of configs, logs, and scripts.


9. less – Read Large Files Safely

less logfile.log
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Handles large files without freezing your terminal.


10. grep – Search Text

Search for patterns inside files.

grep "error" app.log
grep -R "TODO" .
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Debugging, code reviews, and log analysis.


11. find – Locate Files

Search files by name, type, or size.

find . -name "*.js"
find /var -type f -size +100M
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Finding lost files and cleaning disk space.


12. chmod – Change Permissions

chmod +x script.sh
chmod 644 config.txt
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Critical for scripts, deployments, and security.


13. chown – Change File Owner

chown user:user file.txt
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Essential when working with servers and Docker volumes.


14. ps – View Running Processes

ps aux
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Identify stuck or resource-heavy processes.


15. top – Monitor System Resources

top
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Live CPU, memory, and process monitoring.


16. kill – Stop Processes

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

Why it matters:
Terminate frozen or misbehaving applications.


17. df – Disk Space Usage

df -h
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Prevent production outages due to full disks.


18. du – Directory Size

du -sh *
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Find out what is consuming disk space.


19. tar – Archive Files

tar -czvf project.tar.gz project/
tar -xzvf project.tar.gz
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Backups, deployments, and file transfers.


Final Thoughts

You do not need to memorize every Linux command—but these 20 commands form the foundation of daily development work.

If you can confidently use them, you will:

  • Work faster
  • Debug more effectively
  • Feel comfortable on any Linux server
  • Level up as a professional developer

Master the terminal, and the terminal will work for you.

Top comments (0)