Skip to content

Essential Linux Commands for Developers

Working in software development often means spending a lot of time in the terminal, especially on Linux systems. Mastering a few essential commands can significantly boost your productivity. Here’s a quick reference guide to some of the most useful ones.

CommandDescriptionExample Usage
lsList directory contentsls -la (long format, all files)
cdChange directorycd ../projects/my-app
pwdPrint working directorypwd
mkdirCreate directorymkdir new-feature
rmRemove files or directoriesrm -rf old-logs/ (force, recursive)
cpCopy files or directoriescp -r src/ build/
mvMove or rename files/directoriesmv old-name.txt new-name.md
findSearch for files in a directory hierarchyfind . -name "*.js"
CommandDescriptionExample Usage
catConcatenate and display file contentcat README.md
lessView file content page by pageless /var/log/syslog
headDisplay first N lines of a filehead -n 10 config.yaml
tailDisplay last N lines of a filetail -f access.log (follow changes)
grepSearch for patterns in filesgrep -r "error" . (recursive search)
nano / vimText editorsnano script.sh
CommandDescriptionExample Usage
psReport a snapshot of current processes`ps aux
top / htopDisplay Linux processes dynamicallyhtop (more user-friendly)
killSend a signal to processeskill 12345 (terminate process ID 12345)
killallKill processes by namekillall node
systemctlControl the systemd system and service managersudo systemctl status nginx
CommandDescriptionExample Usage
dfReport file system disk space usagedf -h (human-readable)
duEstimate file space usagedu -sh my-project/ (summary, human-readable)
freeDisplay amount of free and used memoryfree -h
unamePrint system informationuname -a (all information)
lscpuDisplay CPU architecture informationlscpu
CommandDescriptionExample Usage
ip addrDisplay IP addresses and network interfacesip addr show eth0
pingSend ICMP ECHO_REQUEST to network hostsping google.com
curlTransfer data from or to a servercurl -I https://codevibr.dev (show headers)
wgetNon-interactive network downloaderwget https://example.com/file.zip
sshOpenSSH remote login clientssh user@remote-host

Understanding file permissions is crucial for security and proper application function.

Terminal window
# View permissions
ls -l my-file.sh
# Change permissions (read, write, execute for owner, group, others)
chmod 755 my-file.sh
# Change ownership
sudo chown user:group my-file.sh
CommandDescriptionExample Usage
apt updateRefresh package listssudo apt update
apt upgradeUpgrade installed packagessudo apt upgrade -y
apt installInstall new packagessudo apt install git
apt removeRemove packagessudo apt remove htop

While not strictly a Linux command, Git is indispensable for developers.

Terminal window
# Initialize a new repository
git init
# Clone a repository
git clone https://github.com/user/repo.git
# Check status
git status
# Add changes to staging area
git add .
# Commit changes
git commit -m "feat: add new feature"
# Push changes to remote
git push origin main

This is just a starting point. The Linux terminal is a powerful environment, and there’s always more to learn. The best way to get comfortable is to use it daily. Experiment, read man pages (man <command>), and don’t be afraid to break things in a safe environment.

Happy coding!