Linux is a powerful operating system that provides a command-line interface (CLI) to interact with the system efficiently. In this blog, we will explore some fundamental Linux commands that every beginner should know.
1. man (manual)
man command is used to display the user manual of any command that we can run on the terminal.
Syntax:
man <command>
Example:
man ls
#Displays the manual for the 'ls' command
2. clear (clear the terminal)
clear command is used to clear the terminal (or) used to remove all the text in the terminal.
Syntax:
clear
3. pwd (print working directory)
pwd command is used to print the present directory you are working in.
Syntax:
pwd
Example output:
/home/user
4 . ls
ls command is used to list the files and directories in the current directory.
Syntax:
ls [options]
common options:
ls -a → to show the hidden files
ls -l → long listing format of the files
Example:
ls -l
5. echo
echo command is used to print the text on the terminal.
Syntax:
echo [message]
Example:
echo “hello world!”
Output:
hello world!
6. whoami
whoami command displays the username of the currently logged-in user.
Syntax:
whoami
Example Output:
charan
7. date
date command displays the current system time and date.
Syntax:
date
Example Output:
Thu Feb 14 10:30:00 IST 2025
8. bc (Basic Calculator)
bc command allows you to perform mathematical calculations.
Syntax:
bc
Example:
echo “10 + 5” | bc
Output:
15
Note:
NOTE: Pipe symbol ( | ) is used to pass the output of the first command as the input of the next command.
In the above example first command echo “10 + 5” output is 10 + 5 , this is passed as a input to the second command bc
9. cal
cal command used to display the calendar of the current month.
Syntax:
cal
Example Output:
You can also get the calendar of any month.
Example:
cal jan 2020
10. help
help command provides information about built-in shell commands.
Syntax:
help [command]
Example:
help ls
11. history
history command displays previously executed commands.
Syntax:
history
Example Output:
ls
pwd
echo “10 + 5” | bc
cal
12. alias
alias command allows you to create custom shortcuts for commands.
Syntax:
alias <shortcut> = “[command]”
Example:
alias ll=”ls -la”
Now typing ll will execute ls -la .
13. sudo
sudo command allow a user to run commands with administrative privileges.
Syntax:
sudo [command]
Example:
sudo apt update
14. su
su command allows switching to another user account.
Syntax:
su <username>
Example:
su root
15. exit
exit command is used to log out or close the terminal session.
Syntax:
exit
Conclusion
These are some of the essential Linux commands that every beginner should learn. Stay tuned for the next blog in this series!
Read the blog Introduction to linux part-1 — https://hashnode.com/post/cm74a32b3000009jjgb4c3ute