May 23, 2021 That's what Linux should learn
Now that the Linux system already has bash so useful "translator", then it is necessary to study how to communicate with it. T o accomplish tasks accurately and efficiently, it is not enough to rely on the commands themselves, and the parameters of the various commands should be flexibly adjusted according to the actual situation. F or example, although we can use a kitchen knife when we cut sushi, the rice grains are sure to be scattered all over the place, so the breathable round holes designed on the sushi knife are additional parameters to better adapt to the scene. O nce you've finished your book and have some work experience, you're sure to understand the mysteries of Linux commands. The format in which Linux commands are commonly executed is as follows:
Command Name (Command Parameters) (Command Object)
Note that the command name, command parameters, and command objects are separated by a space bar.
Command objects generally refer to files, directories, users, and other resources to be processed, while command parameters can be in long format (full option name) or in short format (abbreviations for a single letter), which are prefixed with -- and - respectively (see Table 2-1 for example). L inux nods don't execute commands mostly because the parameters are complex and the parameter values need to change depending on the command and requirements. Therefore, it takes a long time of experience to be flexible with the various parameters and perform the functions you want.
Examples of long and short formats for Table 2-1 command parameters
Long format man --help short format man -h
Readers may now think, "There are so many commands in Linux, how do I know what a command is for?" I 've come across an unfamiliar Linux command in my day-to-day work, so how do I know what parameters are available for it? " Next, we'll use the man command as the first Linux command in the book to teach readers to learn. For true zero-base readers, you can learn how to execute Linux commands in the RHEL 7 system by using Figures 2-2, 2-3, 2-4, and 2-5.
The default host login interface is only for the regular users we just created, so before we officially enter the system, we also need to click on the "Not listed" option to switch to root administrator status, which is a small step taken by the Red Hat RHEL7 system to avoid user abuse of permissions. A nd if we log on to the host using the default linuxprobe user, then some of the commands in the next section will not be executed due to insufficient permissions, and we need sufficient permissions to complete the next experiment. A s for the difference between the students concerned about root administrators and ordinary users, the production environment and how to choose the question, we will slowly tell you in Chapter 5. The login interface switches to root administrator status, as shown in Figure 2-2.
Figure 2-2 Select the Not Listed option and switch to root administrator status.
Step 1: Right-click on the desktop of the RHEL 7 system and select the Open in Terminal command in the pop-up menu, which opens a Linux system command line terminal, as shown in Figure 2-3.
Figure 2-3 opens the command line terminal on a Linux system
Step 2: Enter the man command in the command line terminal to see the help information for the man command itself, as shown in Figure 2-4.
Figure 2-4 View help information for the man command
Step 3: Tap the return button to see the help information shown in Figure 2-5.
Help information for the Figure 2-5 man command
In the interface of the man command help information, the common operating keys contained and their purpose are shown in Table 2-2.
Tables 2-2 man commands are commonly used for keystrokes and purposes
Keystrokes are useful
Space bar Turn down a page
PaGe down turn a page down
PaGe up turn one page up
Home 1 go directly to the home page
End straight to the end page
/ Search for a keyword from top to bottom, such as "/linux"
? Search for a keyword from bottom to top, such as ???linux'
n Locate to the next searched keyword
N navigates to the last searched keyword
q Exit the help documentation
In general, using the man command to look up the help content information will be very long, if the reader does not understand the help document information directory structure and how to operate, at first glance to see so much information may be quite confusing. The structure of the help information for the man command is shown in Table 2-3.
Table 2-3 man commands help the structure and meaning of information
The structure name represents meaning
The name of the NAME and command
The approximate method of use of the SYNOPSIS parameter
Description Description Description
EXAMPLES demo (with simple instructions)
OVERVIEW overview
DEFAULTS default feature
Options specific options available (with introduction)
ENVIRONMENT environment variables
Files used by FILES
SEE ALSO related information
HISTORY maintains history and contact information