Linux Commands
Essential Linux terminal commands.
File Operations
ls -laList all files with details
cd <dir>Change directory
pwdPrint working directory
mkdir <dir>Create a new directory
rm -rf <dir>Remove directory recursively
cp <src> <dest>Copy file or directory
mv <src> <dest>Move or rename file
touch <file>Create an empty file
File Viewing
cat <file>Display file contents
less <file>View file contents page by page
head -n 10 <file>View first 10 lines of a file
tail -f <file>Follow file changes (useful for logs)
grep "pattern" <file>Search for pattern in a file
wc -l <file>Count lines in a file
System Info
topDisplay Linux processes
htopInteractive process viewer (if installed)
df -hShow disk space usage
free -mShow RAM usage in MB
uname -aShow system information
uptimeShow how long the system has been running
whoamiShow current logged in user
Network
ping <host>Ping a host to check connectivity
curl <url>Transfer data from or to a server
wget <url>Download files from the web
netstat -tulnList listening ports
ip addrShow IP addresses and network interfaces
nslookup <domain>Query DNS for domain information
Permissions
chmod 755 <file>Change file permissions
chown user:group <file>Change file owner and group
sudo <cmd>Execute command as superuser
su <user>Switch user
passwdChange password for current user
Archives
tar -czvf <file.tar.gz> <dir>Create a compressed tar archive
tar -xzvf <file.tar.gz>Extract a compressed tar archive
zip -r <file.zip> <dir>Create a zip archive
unzip <file.zip>Extract a zip archive
What are Linux Commands?
Linux commands are text-based instructions used to interact with the Linux operating system via the terminal or shell.
This reference guide helps developers quickly recall essential commands for file manipulation, process management, and system administration.