Four ways to teach yourself Linux commands

Source: Internet
Author: User
Tags root access

If you want to be a master of Linux, then mastering some Linux commands is essential. Here are four ways to teach yourself Linux commands.

Daily Tips

An incremental way to learn about Linux commands is to have the "daily prompt" appear every time you open a terminal. This will introduce you to some useful commands and their advanced usage techniques. In. BASHRC (/HOME/.BASHRC), add the following line:

echo "Did You know that:"; Whatis $ (Ls/bin | Shuf-n 1)

All you have to do is increase the line. If you want to make it more entertaining, you can install Cowsay. Install Cowsay under Ubuntu/debian:

sudo apt-get install Cowsay

Fedora Install Cowsay:

Yum Install Cowsay

In addition to installing Cowsay, you need to add 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 under all Linux distributions.

Use "Whatis"

If you don't like to learn random commands, maybe you like to learn how to use them when you're using some sort of command. Then you just need to add whatis in front of it. Whatis will explain the commands you enter.

The Whatis sudo yum Install cheese example shows you clearly:

sudo is to let you have administrator privileges;

Yun is the Package manager;

Install is to let Yum install package;

Cheese is the software you plan to install. This method does not perform well before complex or uncommon commands. But if you want to understand the general purpose of an order, this method is worth a try.

Browse all available options for a command

If you are using a new command, there are two ways to view its detailed usage. 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 to see the main usage of a command more quickly-"-help". For example, "Cp-help" prints a large number of uses of the CP command directly in 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 useful for understanding commands and is well worth learning.

All Linux commands have the same structure: [sudo] program [parameter] [parameter] ... [Parameter] [-flag] [Parameter] [-flag] [Parameter] ... [Flag] [Parameter] Let me dissect the above structure in sections:

1, if a command requires Administrator privileges (root access) to run, then you must add "sudo" before it. This allows the administrator's password to be entered at Run command.

2, "program" is the name of the application. It includes yum, apt-get, cheese, tar, CP, MV, Firefox, and so on. If no additional configuration is available, all commands that can be accessed in this way are placed in the/usr/bin directory: By default, programs in other directories can run like this, such as commands under/bin. For many programs, you only need to enter their name in the terminal. For example, to enter "Firefox" in the terminal, and then press ENTER, Firefox is running.

3. After the name of the program, you can use different parameters and logos. Different procedures vary widely in this regard. For example, the command "CP file1 file2" Copies a copy of the file1 in its directory and saves it as a file2. The "File1" and "file2" Here are the two parameters of the command "CP". Some commands also change their behavior by using different flags. For example, "Install" in the command "sudo yum install cheese-y" is the yum parameter, "cheese" is the install parameter, and "-Y" is the flag of the Yum-the default answer is "yes" when the Yum asks if you want to continue. It should be noted that some flags have their own parameters, while others do not. No concrete examples are given here. Each Linux name has its own set of logo settings, which takes a long time to accumulate.

Summarize

It's not hard to learn Linux commands-Once you've made up your mind and mastered the basic structure of Linux commands. However, the general study for a few hours will not play a significant effect, then please do not give up. Repetition is the best way to learn. All you have to do is to strengthen your memory through constant practice.

Related Article

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.