Top 100 Linux Commands for Modern Distributions: AlmaLinux, Ubuntu, and Debian

The Linux command line is a powerful tool for managing systems efficiently. Whether you’re using AlmaLinux (a Red Hat Enterprise Linux alternative), Ubuntu, or Debian, these commands form the foundation for everyday tasks like file manipulation, system monitoring, and networking. This article compiles the top 100 essential commands, categorized for clarity. We’ve focused on commands that work across these modern distributions, noting any distro-specific variations (e.g., package managers: apt for Ubuntu/Debian, dnf for AlmaLinux).

image 18

Each category includes a table with the command, a brief description, and an example usage. Examples assume you’re in a terminal; use sudo where elevated privileges are needed.


1. File and Directory Management (Commands 1-20)

These commands handle navigation, creation, and manipulation of files and directories.

#CommandDescriptionExample
1lsLists directory contents.ls -la (detailed list including hidden files)
2pwdPrints current working directory.pwd
3cdChanges directory.cd /etc
4mkdirCreates a new directory.mkdir new_folder
5rmdirRemoves an empty directory.rmdir empty_folder
6rmDeletes files or directories.rm -r folder (recursive)
7cpCopies files or directories.cp file.txt /backup/
8mvMoves or renames files/directories.mv old.txt new.txt
9touchCreates empty files or updates timestamps.touch newfile.txt
10lnCreates hard or symbolic links.ln -s source link (symbolic)
11findSearches for files in a directory hierarchy.find . -name "*.txt"
12locateFinds files by name (uses database).locate config.file
13duEstimates file/directory space usage.du -sh /folder (human-readable summary)
14dfDisplays disk space usage.df -h (human-readable)
15fileDetermines file type.file image.jpg
16statDisplays file or filesystem status.stat file.txt
17treeLists directory contents in a tree-like format.tree /path
18dirLists directory contents (alternative to ls).dir -l
19fdFast alternative to find for file searching.fd pattern
20ddCopies and converts files (e.g., for disk images).dd if=input of=output

2. Text Processing and Viewing (Commands 21-35)

Commands for viewing, editing, and manipulating text files.

#CommandDescriptionExample
21catConcatenates and displays file contents.cat file.txt
22lessViews file contents page by page.less longfile.log
23moreSimilar to less, paginates output.more file.txt
24headDisplays the first lines of a file.head -n 5 file.txt
25tailDisplays the last lines of a file.tail -f /var/log/syslog (follow)
26grepSearches for patterns in files.grep "error" log.txt
27egrepExtended grep (supports more regex).egrep "pattern1|pattern2" file
28fgrepFixed-string grep (no regex).fgrep "string" file
29sedStream editor for filtering/transforming text.sed 's/old/new/g' file.txt
30awkPattern scanning and processing language.awk '{print $1}' file.txt
31sortSorts lines of text files.sort -n numbers.txt (numeric)
32uniqRemoves duplicate lines from sorted input.sort file | uniq
33cutExtracts sections from lines of files.cut -d':' -f1 /etc/passwd
34teeReads from stdin and writes to stdout and files.ls | tee output.txt
35trTranslates or deletes characters.tr 'a-z' 'A-Z' < file.txt

3. System Information and Monitoring (Commands 36-45)

Tools to check system status, resources, and logs.

#CommandDescriptionExample
36unamePrints system information.uname -a (all details)
37uptimeShows system uptime and load average.uptime
38freeDisplays memory usage.free -h (human-readable)
39topInteractive process viewer.top
40htopEnhanced interactive process viewer.htop
41vmstatReports virtual memory statistics.vmstat 1 5 (every second, 5 times)
42iostatReports CPU and I/O statistics.iostat
43dmesgPrints kernel ring buffer messages.dmesg | grep error
44journalctlQueries systemd journal logs.journalctl -u service (Distro note: systemd-based like Ubuntu, Debian, AlmaLinux)
45whoShows who is logged in.who

4. Process Management (Commands 46-55)

Commands for viewing and controlling processes.

#CommandDescriptionExample
46psDisplays current processes.ps aux (all users)
47pstreeDisplays processes in a tree.pstree
48killTerminates processes by PID.kill -9 1234 (force kill)
49killallKills processes by name.killall firefox
50nohupRuns commands immune to hangups.nohup script.sh &
51bgSends a job to the background.bg %1
52fgBrings a job to the foreground.fg %1
53jobsLists active jobs.jobs
54niceRuns commands with modified priority.nice -n 10 command
55reniceAlters priority of running processes.renice -n 5 -p 1234

5. Networking (Commands 56-70)

Essential for network configuration, testing, and file transfer.

#CommandDescriptionExample
56ipManages network interfaces and routing.ip addr show
57ifconfigDisplays/configures network interfaces (deprecated in some distros).ifconfig
58pingTests network connectivity.ping google.com
59tracerouteTraces route to a host.traceroute google.com
60netstatDisplays network connections (deprecated).netstat -tuln
61ssInvestigates sockets (modern alternative).ss -tuln
62nslookupQueries DNS name servers.nslookup google.com
63digDNS lookup utility.dig google.com
64hostPerforms DNS lookups.host google.com
65wgetDownloads files from the web.wget https://example.com/file
66curlTransfers data with URLs.curl https://example.com
67sshSecurely connects to remote hosts.ssh user@host
68scpSecurely copies files over SSH.scp file user@host:/path
69rsyncSyncs files/directories locally or remotely.rsync -av /src/ /dest/
70iptablesConfigures firewall rules.iptables -L (list rules)

6. Package Management (Commands 71-75)

Distro-specific: Use apt for Ubuntu/Debian, dnf for AlmaLinux (or yum as alias).

#CommandDescriptionExample
71aptManages packages on Debian/Ubuntu.apt install package
72dnfManages packages on AlmaLinux/Fedora.dnf install package
73yumOlder package manager (alias to dnf on AlmaLinux).yum update
74rpmHandles RPM packages (low-level).rpm -ivh package.rpm
75apt-getOlder alternative to apt on Debian/Ubuntu.apt-get upgrade

7. User and Permission Management (Commands 76-85)

For managing users, groups, and access rights.

#CommandDescriptionExample
76useraddAdds a new user.useradd -m newuser
77usermodModifies user accounts.usermod -aG sudo user
78userdelDeletes a user.userdel user
79passwdChanges user passwords.passwd user
80suSwitches user.su - user
81sudoExecutes commands as superuser.sudo apt update
82whoamiDisplays current user.whoami
83chownChanges file owner/group.chown user:group file
84chmodChanges file permissions.chmod 755 script.sh
85chgrpChanges group ownership.chgrp group file

8. Disk and Filesystem Management (Commands 86-95)

For partitions, mounting, and filesystem checks.

#CommandDescriptionExample
86fdiskManipulates disk partition tables.fdisk -l (list partitions)
87partedCreates/manipulates partitions.parted /dev/sda
88mkfsBuilds a filesystem.mkfs.ext4 /dev/sdb1
89fsckChecks and repairs filesystems.fsck /dev/sdb1
90mountMounts a filesystem.mount /dev/sdb1 /mnt
91umountUnmounts a filesystem.umount /mnt
92blkidLocates/prints block device attributes.blkid
93lsblkLists block devices.lsblk
94partxTells kernel about disk partitions.partx -a /dev/sda
95ncduDisk usage analyzer.ncdu /

9. Archiving and Compression (Commands 96-100)

For compressing and archiving files.

#CommandDescriptionExample
96tarArchives files.tar -czvf archive.tar.gz /dir
97gzipCompresses files.gzip file.txt
98gunzipDecompresses gzip files.gunzip file.txt.gz
99zipCreates zip archives.zip archive.zip files
100unzipExtracts zip archives.unzip archive.zip

These commands will empower you to handle most tasks on AlmaLinux, Ubuntu, or Debian. For more details, use man command or --help. Practice in a virtual machine to build confidence!

Tags: , ,