Linux Command Line Interface Cheatsheet

Cerulean CloudCerulean Cloud
3 min read

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

CommandDescriptionExample Usage
pwdPrints the current working directory.pwd
lsLists files and directories in the current directory.ls -l
cdChanges the current directory.cd /home
mkdirCreates a new directory.mkdir my_folder
rmdirRemoves an empty directory.rmdir my_folder
touchCreates a new empty file.touch myfile.txt
cpCopies files or directories.cp file1.txt file2.txt
mvMoves or renames files or directories.mv file1.txt /backup/
rmDeletes files or directories.rm file1.txt
catDisplays the contents of a file.cat file1.txt
headDisplays the first lines of a file.head -n 5 file1.txt
tailDisplays the last lines of a file.tail -n 5 file1.txt
chmodChanges file or directory permissions.chmod 755 myfile.txt
chownChanges file or directory ownership.chown user:group myfile.txt
findSearches for files and directories.find / -name "file1.txt"
grepSearches for a text pattern within files.grep "text" file1.txt
psLists current running processes.ps aux
topDisplays real-time system processes.top
killTerminates a process.kill 1234
dfShows disk space usage.df -h
duShows disk usage of files and directories.du -sh *
freeDisplays memory usage.free -h
unameShows system information.uname -a
ifconfigDisplays network interface configuration.ifconfig
pingTests network connectivity.ping google.com
wgetDownloads files from the internet.wget http://example.com
tarArchives files and directories.tar -cvf archive.tar my_folder/
nanoOpens a basic text editor.nano myfile.txt
aptInstalls or updates packages (Debian-based systems).apt update && apt install vim
yumInstalls or updates packages (Red Hat-based systems).yum install nano
rebootReboots the system.reboot
shutdownShuts down the system.shutdown now

When you are done testing all the above commands, you should have gathered beginner-level Linux system administration skills.

0
Subscribe to my newsletter

Read articles from Cerulean Cloud directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Cerulean Cloud
Cerulean Cloud