Linux Command Line Interface Cheatsheet
Linux is an open-source operating system known for its versatility, stability, and efficiency. It is widely used in various fields, from personal computing to servers, development, and embedded systems. Linux is built on a modular design, allowing users to modify and customize it according to their needs. One of the key reasons for its popularity is the powerful command-line interface (CLI), which provides deep control over the system through various commands.
The CLI is a text-based interface that allows users to interact with the operating system by typing commands. Unlike graphical user interfaces (GUIs), the CLI may initially seem intimidating, but it offers unmatched flexibility, precision, and speed once mastered. For system administrators, developers, and power users, the CLI is essential for managing files, running scripts, troubleshooting, and automating tasks.
For those new to Linux, becoming familiar with basic commands is the first step to mastering the CLI. The table below introduces essential commands in a logical sequence, covering navigation, file management, system monitoring, networking, and basic administrative tasks. These commands will provide a solid foundation for beginners and help them perform routine tasks and manage their system effectively.
Linux Basic Commands
Command | Description | Example Usage |
pwd | Prints the current working directory. | pwd |
ls | Lists files and directories in the current directory. | ls -l |
cd | Changes the current directory. | cd /home |
mkdir | Creates a new directory. | mkdir my_folder |
rmdir | Removes an empty directory. | rmdir my_folder |
touch | Creates a new empty file. | touch myfile.txt |
cp | Copies files or directories. | cp file1.txt file2.txt |
mv | Moves or renames files or directories. | mv file1.txt /backup/ |
rm | Deletes files or directories. | rm file1.txt |
cat | Displays the contents of a file. | cat file1.txt |
head | Displays the first lines of a file. | head -n 5 file1.txt |
tail | Displays the last lines of a file. | tail -n 5 file1.txt |
chmod | Changes file or directory permissions. | chmod 755 myfile.txt |
chown | Changes file or directory ownership. | chown user:group myfile.txt |
find | Searches for files and directories. | find / -name "file1.txt" |
grep | Searches for a text pattern within files. | grep "text" file1.txt |
ps | Lists current running processes. | ps aux |
top | Displays real-time system processes. | top |
kill | Terminates a process. | kill 1234 |
df | Shows disk space usage. | df -h |
du | Shows disk usage of files and directories. | du -sh * |
free | Displays memory usage. | free -h |
uname | Shows system information. | uname -a |
ifconfig | Displays network interface configuration. | ifconfig |
ping | Tests network connectivity. | ping google.com |
wget | Downloads files from the internet. | wget http://example.com |
tar | Archives files and directories. | tar -cvf archive.tar my_folder/ |
nano | Opens a basic text editor. | nano myfile.txt |
apt | Installs or updates packages (Debian-based systems). | apt update && apt install vim |
yum | Installs or updates packages (Red Hat-based systems). | yum install nano |
reboot | Reboots the system. | reboot |
shutdown | Shuts down the system. | shutdown now |
When you are done testing all the above commands, you should have gathered beginner-level Linux system administration skills.
Subscribe to my newsletter
Read articles from Cerulean Cloud directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by