Table of contents
Introduction
Linux commands are instructions you type into the terminal to make the operating system do things.
Remember, in Linux, uppercase and lowercase letters matter in commands.
You can do lots of stuff with Linux commands, like managing files, networking, handling processes, and managing users.
Many Linux commands are similar to ones used in Unix, with over 100 commands in common.
Experienced users can customize Linux commands for advanced tasks.
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
Learning basic Linux commands is important for using the system smoothly.
These commands help you handle files, folders, and other tasks easily.
Once you know these basics, you'll find it easier to explore advanced Linux features.
Practice using these commands regularly to get better at using Linux.
Embrace the command line as a handy tool for getting things done quickly on Linux.