Four methods to learn Linux commands

Source: Internet
Author: User

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:

  1. 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:

  1. Sudo apt-get install cowsay

Install cowsay under Fedora:

  1. Yum install cowsay

In addition to installing cowsay, you also need to add the following in. bashrc:

  1. 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.

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.