Master essential Linux commands through 10 comprehensive lessons
This course is designed to help you master essential Linux commands across 10 key categories. Each lesson covers 10 important commands with practical examples to reinforce your learning. Click on any lesson to view its content.
| Command | Description | Example |
|---|---|---|
| ls | List directory contents | ls -la |
| cd | Change directory | cd /home/user/Documents |
| pwd | Print working directory | pwd |
| mkdir | Create directory | mkdir new_folder |
| rmdir | Remove empty directory | rmdir empty_folder |
| cp | Copy files/directories | cp file1.txt file2.txt |
| mv | Move/rename files/directories | mv oldname.txt newname.txt |
| rm | Remove files/directories | rm file.txt |
| touch | Create empty file or update timestamp | touch newfile.txt |
| file | Determine file type | file document.pdf |
| Command | Description | Example |
|---|---|---|
| cat | Concatenate and display file content | cat file.txt |
| less | View file content page by page | less longfile.txt |
| more | View file content page by page | more longfile.txt |
| head | Display first lines of a file | head -n 10 file.txt |
| tail | Display last lines of a file | tail -n 5 file.txt |
| nano | Simple text editor | nano file.txt |
| vim | Advanced text editor | vim file.txt |
| grep | Search text using patterns | grep "error" logfile.txt |
| sed | Stream editor for text transformation | sed 's/old/new/g' file.txt |
| awk | Pattern scanning and processing language | awk '{print $1}' file.txt |
| Command | Description | Example |
|---|---|---|
| chmod | Change file permissions | chmod 755 script.sh |
| chown | Change file owner and group | chown user:group file.txt |
| ln | Create links between files | ln -s target link_name |
| find | Search for files in a directory hierarchy | find /home -name "*.txt" |
| locate | Find files by name | locate filename |
| which | Locate a command | which python |
| whereis | Locate binary, source, and manual pages | whereis ls |
| diff | Compare files line by line | diff file1.txt file2.txt |
| cmp | Compare two files byte by byte | cmp file1.bin file2.bin |
| sort | Sort lines of text files | sort file.txt |
| Command | Description | Example |
|---|---|---|
| grep | Search text using patterns | grep -r "pattern" /path/ |
| awk | Pattern scanning and processing | awk '/error/ {print $1,$2}' file.log |
| sed | Stream editor for text transformation | sed -n '5,10p' file.txt |
| cut | Remove sections from each line of files | cut -d: -f1 /etc/passwd |
| paste | Merge lines of files | paste file1.txt file2.txt |
| join | Join lines of two files on a common field | join file1.txt file2.txt |
| tr | Translate or delete characters | tr 'a-z' 'A-Z' < file.txt |
| uniq | Report or omit repeated lines | sort file.txt | uniq |
| wc | Print newline, word, and byte counts | wc -l file.txt |
| tee | Read from standard input and write to files | ls -la | tee directory_listing.txt |
| Command | Description | Example |
|---|---|---|
| chmod | Change file mode bits | chmod u+x script.sh |
| chown | Change file owner and group | chown user:group file.txt |
| chgrp | Change group ownership | chgrp admin file.txt |
| umask | Set file mode creation mask | umask 022 |
| getfacl | Get file access control lists | getfacl file.txt |
| setfacl | Set file access control lists | setfacl -m u:user:rw file.txt |
| id | Print real and effective user/group IDs | id |
| groups | Print group memberships | groups username |
| whoami | Print effective userid | whoami |
| su | Change user ID or become superuser | su - username |
| Command | Description | Example |
|---|---|---|
| useradd | Create a new user account | useradd -m newuser |
| usermod | Modify a user account | usermod -aG sudo username |
| userdel | Delete a user account | userdel -r username |
| passwd | Change user password | passwd username |
| groupadd | Create a new group | groupadd newgroup |
| groupmod | Modify a group | groupmod -n newname oldname |
| groupdel | Delete a group | groupdel groupname |
| who | Show who is logged on | who |
| w | Show who is logged on and what they're doing | w |
| last | Show listing of last logged in users | last |
| Command | Description | Example |
|---|---|---|
| ps | Report a snapshot of current processes | ps aux |
| top | Display Linux processes | top |
| htop | Interactive process viewer | htop |
| kill | Terminate a process | kill 1234 |
| killall | Kill processes by name | killall process_name |
| pkill | Signal processes based on name and attributes | pkill -f process_name |
| bg | Place a job in the background | bg %1 |
| fg | Bring a job to the foreground | fg %1 |
| jobs | List active jobs | jobs |
| nice | Run a program with modified scheduling priority | nice -n 10 command |
| Command | Description | Example |
|---|---|---|
| top | Display Linux tasks | top |
| htop | Interactive process viewer | htop |
| vmstat | Report virtual memory statistics | vmstat 1 10 |
| iostat | Report CPU and I/O statistics | iostat -x 1 |
| free | Display amount of free and used memory | free -h |
| df | Report file system disk space usage | df -h |
| du | Estimate file space usage | du -sh /path/to/directory |
| uptime | Show how long the system has been running | uptime |
| sar | Collect, report, or save system activity information | sar -u 1 5 |
| dmesg | Print or control the kernel ring buffer | dmesg | tail -20 |
| Command | Description | Example |
|---|---|---|
| ping | Send ICMP ECHO_REQUEST to network hosts | ping google.com |
| traceroute | Print the route packets take to network host | traceroute google.com |
| netstat | Print network connections, routing tables, etc. | netstat -tuln |
| ss | Another utility to investigate sockets | ss -tuln |
| ip | Show/manipulate routing, devices, policy routing | ip addr show |
| ifconfig | Configure a network interface | ifconfig eth0 |
| route | Show/manipulate the IP routing table | route -n |
| host | DNS lookup utility | host google.com |
| nslookup | Query Internet name servers interactively | nslookup google.com |
| wget | Non-interactive network downloader | wget http://example.com/file.zip |
| Command | Description | Example |
|---|---|---|
| apt-get | APT package handling utility | apt-get install package_name |
| apt | Command-line interface for package management | apt update |
| dpkg | Package manager for Debian | dpkg -i package.deb |
| yum | Package manager for RPM-based systems | yum install package_name |
| dnf | Next-generation version of YUM | dnf install package_name |
| rpm | RPM Package Manager | rpm -ivh package.rpm |
| pacman | Package manager for Arch Linux | pacman -S package_name |
| zypper | Command-line interface for ZYpp system management | zypper install package_name |
| snap | Install, configure, and manage snap packages | snap install package_name |
| flatpak | Linux application sandboxing and distribution | flatpak install app_name |