Linux Commands You Should Master
Table of contents
🢒Click to expand!

Linux commands form the backbone of navigating and managing a Linux system efficiently through the terminal. Whether you're a beginner or an experienced user, mastering these commands will greatly enhance your productivity and control over your system. In this article, here are the top Linux commands that every user should master for effective terminal usage
Navigation and File Management
cd: Change directory
cd directory_namels: List directory contents
ls options directory_pathpwd: Print working directory
pwdcp: Copy files and directories
cp source_file destination_filemv: Move (rename) files and directories
mv source destinationrm: Remove files and directories
rm file_namemkdir: Make directories
mkdir directory_namermdir: Remove empty directories
rmdir directory_namecat: Concatenate and display files
cat file_nameless/more: View file contents interactively (one screen at a time)
less file_name
more file_namehead/tail: View the beginning or end of a file
head file_name
tail file_namegrep: Search for patterns in files
grep pattern file_namefind: Search for files in a directory hierarchy
find directory_path optionsln: Create links between files
ln -s target_file link_namechmod: Change file permissions
chmod permissions file_namechown: Change file owner and group
chown owner:group file_nameProcess Management
ps: Display information about active processes
pskill: Terminate processes
kill process_idtop/htop: Display system processes in real-time
top
htopSystem Information
df: Display disk space usage
df optionsdu: Estimate file space usage
du options file_namefree: Display amount of free and used memory in the system
freeuname: Print system information
uname -auptime: Show how long the system has been running
uptimeNetwork Management
ping: Check the connectivity to a server or network device
ping hostname_or_ipifconfig/ip: Display and configure network interfaces
ip addr shownetstat: Print network connections, routing tables, interface statistics, etc.
netstat optionswget/curl: Download files from the internet
wget URL
curl -O URLSystem Administration
sudo: Execute a command as the superuser (root)
sudo commandshutdown/reboot: Shutdown or reboot the system
shutdown options
rebootservice/systemctl: Control system services (systemd-based systems)
systemctl start|stop|restart service_namejournalctl: Query and display system logs
journalctl optionspasswd: Change user password
passwdText Processing
awk: A versatile programming language for pattern scanning and processing
awk 'pattern { action }' filesed: Stream editor for filtering and transforming text
sed 's/search/replace/g' filecut: Remove sections from each line of files
cut options filesort: Sort lines of text files
sort options fileuniq: Report or omit repeated lines
uniq options filewc: Print newline, word, and byte counts for each file
wc options fileCompression and Archiving
tar: Archive files and directories
tar options archive_name filesgzip/gunzip: Compress or decompress files
gzip file
gunzip file.gzbzip2/bunzip2: Another compression utility
bzip2 file
bunzip2 file.bz2Miscellaneous
echo: Display a line of text or variables
echo "Hello, world!"date: Display or set the system date and time
datewatch: Execute a program periodically, showing output fullscreen
watch commandalias: Create an alias for a command
alias short_name='command sequence'history: Display command history
historywhoami: Display the current username
whoamitouch: Change file timestamps or create empty files
touch file_namescp/rsync: Securely copy files between hosts
scp file user@host:destination
rsync options source destinationConclusion
Mastering these Linux commands will empower you to efficiently manage files, processes, networks, and more directly from the terminal. Whether you're a system administrator, developer, or Linux enthusiast, these commands are indispensable tools for your daily workflow.
Happy Linux command-line hacking!