A. Shell command
Users determine which shell to use by the / etc / passwd file when logging in to Linux. For example: # fgrep lisa / etc / passwdlisa: x: 500: 500: TurboLinux User: / Home / Lisa: / bin / Bashshell is column each end (/ bin / bash). Since Bash is the default shell on Linux, this chapter mainly introduces Bash and its related knowledge. When the shell command command line C logs in to the Linux system, you can see a shell prompt and identify the beginning of the command line. Users can enter any commands and parameters later. For example: $ DATE II 11 23 01:34:58 CST 1999 When the user logs in, I actually entered the shell, which follows a certain syntax to explain the input command and transmit it to the system. The first word entered in the command line must be a command name, the second word is the option or parameter of the command, and each word in the command line must be separated by spaces or TAB, the format is as follows: $ comMMAND Option Arguments
The options and parameter options are code including one or more letters, with a minus sign in front (decimal, Linux to distinguish options and parameters), options can be used to change the type of action executed by the command. For example: $ lsmotd passwd $ This is an LS command without options, which can list all files in the current directory, only listing the names of each file without displaying other more information. $ LS -LTOTAL 2-RW-R - R - 2 WZH Book 22 APR 20 20:37 MOTD-RW-R - R - 2 WZH Book 796 APR 20 20:37 Passwd $ Add -L Option, Will list a line of lines for each file, such as data size and data last modified. Most commands are designed to accept parameters. The parameter is one or more words typed after the option in the command line, for example: $ ls -l text-rw-r - r - 2 WZH Book 22 APR 20 20:37 MOTD-RW-R - R - 2 WZH Book 796 APR 20 20:37 Passwd $ will display all files and their information in the Text directory. Some commands, such as the LS can be used, and some commands may require some minimum number of parameters. For example, the CP command requires at least two parameters, and if the number of parameters does not match the command, the shell will give an error message. For example: $ cp -i mydata newdata Note: The options in the command line are first in parameter input.