Linux System shell command and Help document command (man)

Source: Internet
Author: User

1. Powerful and useful shell command

Generally speaking, computer hardware is composed of operators, controllers, memory, input/output devices and so on, and let a variety of hardware devices and can work together to operate the system core. The kernel of Linux system is responsible for the allocation of hardware resources, scheduling and other management tasks. Thus, the system checks the normal operation of the computer is too important, it is generally not recommended to directly edit the kernel parameters, but let the user through the system call interface developed programs or services to manage the computer to meet the needs of daily work, 1 shows.

It is important to be sure that some graphical tools (such as the logical Volume Manager [Logical Volume MANAGER,LVM]) in the Linux system are very useful, which greatly reduces the probability of operator error and is commendable. However, many graphical tools actually call the script to do the corresponding work, often just to complete some kind of work and design, lack of the original Linux command flexibility and controllability. Furthermore, the graphical tool consumes more system resources than the Linux command-line interface, so experienced ops people do not even install the GUI on the Linux system and need to start the operation to connect the past directly through the command-line mode, and have to say that it is very efficient.

Figure 1 user interaction with a Linux system

The shell is one such command-line tool. A shell ( also known as a terminal or shell) acts as a translator between the human and the kernel (hardware), and the user "tells" the terminal that it will invoke the appropriate program service to do some work. Many mainstream Linux systems, including Red Hat systems, are now using the Bash (Bourne-again SHell) interpreter as the default endpoint. Mainstream Linux system choose Bash interpreter as the command line terminal has the following 4 advantages, readers can learn and production work in the future to understand the Linux system command line of the wonderful, really love them from the heart.

    • Through the upper and lower arrow keys to adjust the past executed Linux commands;
    • Commands or parameters only need to input the first few can be used to complete the TAB key;
    • Has a powerful batch processing script;
    • has a practical environment variable function.
2. Execute the Help document command

The Linux system already has the bash so Good "translator", then needs to learn how to communicate with it. To accomplish various tasks accurately and efficiently, it is not enough to rely solely on the command itself, and the parameters of various commands should be flexibly adjusted according to the actual situation. The common format for executing Linux commands is this:

command name [command arguments] [command object]

Note that the command name, command arguments, and command objects are separated by a space key.

Command objects generally refer to the files, directories, users and other resources to be processed, while command parameters can be in long format (full option name), or in short format (single letter abbreviation), the two are prefixed with "--" and "-" (see table 1 for example). Most Linux novices do not execute commands, because parameters are complex and parameter values need to change with different commands and requirements. Therefore, to be flexible with various parameters, to perform the functions you want, it will take a long time to accumulate experience.

Table 1 Example of long format and short format for command arguments

Long format

Man --Help

Short format

Man -H

In Linux there is a help command to see how parameters are used, man, I can use it to view and learn Linux commands when I don't know what a command is for, and if there are parameters available for an unfamiliar Linux command.

The Linux default host login interface is only our new normal user, so before we can formally enter the system, we also need to click the "not listed" option to switch to the root administrator, which is a small measure that Red Hat RHEL7 system takes to avoid user's disorderly use of permission. If we use the default normal user login to the host, some of the commands will not be able to execute due to insufficient permissions, we need sufficient permissions to complete the next experiment. The login interface switches to root administrator status, as shown in 2.

Figure 2 Select the "not listed" option to switch to root administrator status.

Right-click on the desktop of the Rhel 7 system and select the open in Terminal command from the pop-up menu, which will open a Linux system command line terminal, as shown in 3.

Figure 3 Opening a command-line terminal on a Linux system

Enter the man man command in the command line terminal to view the help information for the Man command itself, as shown in 4.

Figure 4 Viewing Help for the man command

You can see the Help information shown in 5 after hitting the ENTER key.

Figure 5 Help information for the man command

In the man command Help information interface, the common operating buttons and their uses are shown in table 2.

Table 2 common keys and uses in Man command

Keys

Use

Space key

Turn down one page

PaGe down

Turn down one page

PaGe up

Turn up one page

Home

Go directly to the homepage

End

Go directly to the last page

/

Search for a keyword from top to bottom, such as "/linux"

?

Search for a keyword from bottom to top, such as "? Linux"

N

Navigate to the next search keyword

N

Navigate to the previous search keyword

Q

Exit the Help document

In general, the Help content that you see with the man command can be a lot longer, and if readers don't understand the directory structure and how to do it, it might be confusing to see so much information at first glance. The structure of the help information for the Man command is shown in table 3.

Table 3 The structure and significance of the man command Help information

Structure name

Representative meaning

NAME

Name of the command

Synopsis

Approximate method of using parameters

DESCRIPTION

Introduction description

EXAMPLES

Demo (with simple instructions)

Overview

Overview

DEFAULTS

The default features

OPTIONS

Specific available options (with introduction)

Environment

Environment variables

FILES

Files used

See ALSO

Related information

History

Maintenance History and contact information

Linux System shell command and Help document command (man)

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.