If you want to become a Linux expert, it is essential to master some Linux commands. The following are four methods to learn Linux commands.
Daily prompt
A progressive method to learn Linux commands is to display a "Daily prompt" every time you open the terminal ". This will introduce you to some useful commands and their advanced usage skills.
In. bashrc (/Home/. bashrc) Add the following line:
- Echo "Did you know that:"; whatis $ (ls/bin | shuf-n 1)
You only need to add this line! If you want to make it more entertaining, you can install cowsay. Install cowsay in Ubuntu/Debian:
- Sudo apt-get install cowsay
Install cowsay under Fedora:
- Yum install cowsay
In addition to installing cowsay, you also need to add the following in. bashrc:
- Cowsay-f $ (ls/usr/share/cowsay/cows | shuf-n 1 | cut-d. -f1) $ (whatis $ (ls/bin) 2>/dev/null | shuf-n 1)
However, the above method of using cowsay does not run successfully in all Linux distributions.
Use "whatis"
If you do not like to learn random commands, you may like to learn their usage when using a command. In this case, you only need to add whatis in front of it. Whatis will explain the commands you entered one by one.
The whatis sudo yum install cheese example clearly tells you:
1) sudo gives you administrator privileges;
2) yun is the software package manager;
3) install is to allow YUM to install the software package;
4) cheese is the software you plan to install.
This method does not work well before complicated or uncommon commands. However, if you want to know the general purpose of a command, this method is worth a try.
Browse all available options of commands
If you are using a new command, you can view its usage in two ways. One way is "man <program>", where <program> is the name of the program you want to run. For example, "man cp" will tell you the detailed usage of cp in the man file browser.
Another way is to view the main usage of a command faster-"-help ". For example, "cp-help" directly prints a large number of usage of the cp command on the terminal. In other words, the-help option has the same meaning in all Linux commands.