Introduction
Linux provides a powerful command line environment that developers use daily for navigation, file management, system monitoring, and networking. Below are essential commands with examples you can copy and use directly.
Navigation Commands
pwd :: print current working directory
ls :: list files and folders
ls -la :: list all files with details
cd foldername :: change directory
cd .. :: go up one directory
File and Folder Management
mkdir myproject :: create a new folder
rmdir myproject :: remove an empty folder
rm file.txt :: delete a file
rm -r foldername :: delete a folder and its contents
cp file.txt /home/user/backup/ :: copy file
mv file.txt /home/user/work/ :: move file
File Viewing and Editing
cat file.txt :: display file contents
less file.txt :: view file with scrolling
nano file.txt :: edit file in nano editor
vim file.txt :: edit file in vim editor
System Information
whoami :: show current user
date :: show date and time
uname -a :: show system details
df -h :: show disk usage
free -m :: show memory usage
Process and Task Management
ps aux :: list running processes
top :: monitor processes in real time
kill -9 PID :: kill process by ID
htop :: interactive process viewer (if installed)
Networking Commands
ping google.com :: test connectivity
curl example.com :: fetch content from URL
wget example.com :: download file from URL
ifconfig :: show network interfaces (deprecated, use ip)
ip addr :: show IP addresses
netstat -tulnp :: show active ports (if installed)
Package Management
sudo apt update :: update package list (Debian/Ubuntu)
sudo apt upgrade :: upgrade packages
sudo yum update :: update packages (CentOS/Fedora)
sudo pacman -Syu :: update packages (Arch)
Developer Utilities
git --version :: check Git installation
node -v :: check Node.js version
python3 --version :: check Python version
gcc --version :: check C compiler version
java -version :: check Java installation
Conclusion
These Linux commands cover navigation, file management, system monitoring, networking, and developer utilities. By mastering them, developers can streamline daily tasks and work more efficiently in the Linux environment.