Four methods to learn Linux commands

Source: Internet
Author: User
Tags root access

Four methods to learn Linux commands
GuideWhen children's shoes are new to linux, they will encounter many problems during the learning process. If they are confused about linux, the following describes four linux learning methods, which are especially suitable for new users.Method 1: terminal "Daily prompt"

Add the following line to. bashrc (/home/. bashrc:

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.

Method 2: Run "whatis"

For example, if you do not like random commands in linux, you only need to add whatis before it. Whatis will explain the commands you entered one by one.
Learncommands_whatis

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.

Method 3: Run "man"

When I first came into contact with linux, I was not very familiar with basic commands. Sometimes I felt that there were too many command parameters and I couldn't remember them. Here is a trick: Use the command "man + command ", the detailed parameters and explanations of this command can be displayed: for example, "man cp ":

Another simple and quicker method: the command "-help ". For example, "cp-help" directly prints a large number of usage of the cp command on the terminal.

Method 4: quickly understand linux command syntax

Here, you can not only use the man command to query the usage of Linux commands, but also quickly understand the basic syntax of Linux commands, which is helpful for understanding commands!

[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 administrator permissions (root access permission), you must add "sudo" before it ". In this way, you can use the Administrator permission without the administrator password.

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.

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.

Address: http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/

Reposted at: http://www.linuxprobe.com/linux-studyway.html #


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.