Table of contents
Introduction
Linux commands are written instructions that you enter into the terminal to control the operation of the operating system.
Keep in mind that commands in Linux require both uppercase and lowercase letters.
Linux commands cover a wide range of tasks, including file management, networking, process management, and user management.
There exist more than 100 commands that are comparable across Unix and Linux.
Linux commands can be customized by knowledgeable users for complex operations.
Basic Commands
Command | Description |
man | Displays the manual pages for commands and utilities. |
ls | Lists files and directories in the current directory. |
cd | Changes the current directory. |
date | Displays or sets the system date and time. |
cal | Displays a calendar. |
clear | Clears the terminal screen. |
whoami | Displays the current username. |
pwd | Prints the current working directory. |
mkdir | Creates a new directory. |
touch | Creates a new empty file. |
echo | Displays text or variables. |
cat | Displays the contents of a file. |
cp | Copies files or directories. |
mv | Moves files or directories or we can rename it as well. |
rm | Removes files or directories ( in case we use rm -r ) . |
rmdir | Removes an empty directory. |
more | Displays the contents of a file one screen at a time. |
less | Displays the contents of a file, allowing backward movement. |
head | Displays the first few lines of a file. |
tail | Displays the last few lines of a file. |
sudo | Executes a command with superuser privileges. |
su | Switches user or runs a command as a different user. |
top | Displays real-time system resource usage. |
which | Shows the full path of shell commands. |
df | Displays disk space usage. |
free | Displays the amount of free and used memory in bytes. |
du | Displays disk usage of files and directories. |
wget | Downloads files from the internet. |
find | Searches for files in a directory hierarchy. |
alias | Creates shortcuts for commands. |
history | Displays command history. |
sort | Sorts lines of text files. |
vi | Opens the Vi text editor. |
ln | Creates links between files/directories. |
diff | Compares files line by line. |
wc | Counts lines, words, and characters in a file. |
uptime | Displays how long the system has been running. |
tree | Displays the contents of directories in a tree-like format. |
Conclusion
To use Linux smoothly, you should become familiar with its fundamental commands.
You may simply manage files, directories, and other operations with the use of these commands.
It will be simpler for you to investigate advanced Linux features if you understand these fundamentals.
Regular practice with these commands can help you become more proficient with Linux.
Accept the command line as a helpful resource for completing tasks fast on Linux.