We will now do a quick up-to-date review of the most commonly used bash commands in the various linux distributions, dividing them by type and syntax.
If you watched our Linux video tutorial for beginners then I encourage you to proceed further, otherwise I recommend that you read the previous lesson so that you can better understand what we will now cover.
In the following topics we will use only terminal (shell) bash commands.
The bash commands described here are fairly common for all Linux distributions; variations are minimal.
HELP COMMANDS
COMMAND NAME | DESCRIPTION | SYNTAX | NOTES |
--help |
Show a short help screen related to a command | command_name --help |
ls --help shows a help screen on the ls command |
man |
Shows more detailed guidance related to the specified command. It is the actual manual for all shell commands | man command_name |
man ls shows the manual page about the whole ls command, its options and arguments |
FILE MANAGER AND FILE SYSTEM
COMMAND NAME | DESCRIPTION | SYNTAX | NOTES |
pwd |
Show the path to the directory we are in | pwd |
– |
ls |
Displays the list of files and folders in the directory we are in | ls [option] [directory] |
Learn More |
cd |
Used to move within the directories of the filesystem | cd [directory] |
Learn More |
touch |
The touch command is used to update the date of the last access or that of the last modification of a file. If followed by a file name not yet present, it creates a blank one with the given extension | touch [options] file |
Learn More |
mkdir |
Create a directory | mkdir [foldername] |
mkdir fish creates a directory called fish |
mv |
With this command you can move files or directories (move). It can also be used to rename a file or directory | mv [options] Source Dest |
Learn More |
cp |
Copy one or more files to a specific location | cp [options] Source Dest |
Learn More |
cat |
View and concatenate the contents of files | cat [options] [file] |
Learn More |
rm |
Delete Files. You can use -r option to remove each listed directory too, along with all of its contents | rm [options] [file] |
Learn More |
more |
Displays the contents of a file in multiple video pages. The Enter key advances the view line by line while the space bar advances video pages. To exit use CTRL+Z | more [options] [file] |
Learn More |
less |
It features the same functions as more command but improved. Also usable concatenated with other commands | less [options] [file] or command_name | less [options] |
Learn More |
SYSTEM COMMANDS
COMMAND NAME | DESCRIPTION | SYNTAX | NOTES |
free |
Display memory status and usage | free |
– |
df |
Display free disk space | df [option] [file] |
You can use df -h for a quick and easy report or you can Learn More about this command |
ps |
Process status, information about processes running in memory | ps [options] |
You can use ps -aux for check most useful and essential information about processes. Learn More for other options |
top |
Alternative to ps command with real-time monitoring. Find the CPU-intensive programs currently running |
top [options] |
Learn More |
uname |
Display system information | uname [options] |
Learn More |
ip |
Show / manipulate routing, devices, policy routing and tunnels | Learn More | You can also use ifconfig (deprecated on modern distros) |
GO TO PREVIOUS LESSON ⬅ 🚧 NEXT LESSON COMING SOON🚧