Quick start: 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. A progressive method to learn Linux commands is to display daily prompts every time you open the terminal. This will introduce you to some useful Linux Commands

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. Add the following line to. bashrc (/home/. bashrc:

 
 
  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 the administrator permission; 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 <程序> ", Where <程序> 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.

Crash Course -- yes, now!

Finally, you can learn the syntax of Linux commands here! Understanding the basic syntax of Linux commands is very helpful for understanding commands. it is worth learning.

All Linux commands have the same structure: [sudo] program [parameter] [parameter]… [Parameter] [-flag] [parameter] [-flag] [parameter]… [Flag] [parameter]

Let me analyze the above structure in segments:

  1. If a command can run only with the administrator permission (root access permission), you must add "sudo" before it ". This allows you to enter the administrator password when running the command.
  2. "Program" is the name of the application. It includes yum, apt-get, cheese, tar, cp, mv, and firefox. Without additional configuration, all commands that can be accessed using this method are stored in the/usr/bin directory: by default, programs in other directories can run like this, for example, commands in/bin ). For many programs, you only need to enter their names in the terminal. For example, Enter "firefox" in the terminal and press Enter to run Firefox.
  3. After the program name, you can use different parameters and flag. Different programs vary greatly in this regard. For example, run the "cp file1 file2" command to copy and save file1 as file2. Here, "file1" and "file2" are two parameters of the "cp" command. Some commands also use different labels to change their behavior. For example, in the command "sudo yum install cheese-y", "install" is the yum parameter, and "cheese" is the install parameter, "-y" indicates yum. When yum asks you if you want to continue, "yes" is answered by default ". Note that some flags have their own parameters, while others do not. Here we will not give a specific example. Each Linux name has its own set of logos. it takes a long time to master these settings.

Summary

Learning Linux commands is really not difficult-once you have made up your mind and mastered the basic structure of Linux commands. However, learning for a few hours usually does not play a significant effect. please do not give up. Repetition is the best way to learn. What you need to do is to strengthen your memory through continuous practices. There are many resources to learn Linux commands, such as the quick query of Linux commands, 40 important Linux commands, and a quick start to Linux commands.

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.