Command prompt: Prompt
On the left is the root user, and the command prompt is #
The right side is a normal user, and the command prompt is $
The command prompt is intended to prompt us to enter a command, what is a command?
At the command prompt, enter the command, carriage return. The equivalent of drawing the shell program to find the executable program or code corresponding to the type command, which is analyzed and handed over to the kernel to allocate resources to run it as one or more processes.
[email protected]:/# which ls/bin/ls[email protected]:/# whereis Lsls:/bin/ls/usr/share/man/man1/ls.1.gz[email protected]:/# ^c[email protected]:/# which cd[email protected]:/# whereis CDCD:
There are 2 types of commands that can be executed in the shell system:
Built-in command: Comes with a shell and is provided in some form of command, such as a CD
External command: There is a corresponding executable program file under a file system path of the current system. For external commands, you can use the which, Whereis command to see where the command is
How do you know if a command is built-in?
Type COMMAND
[Email protected]:/# type CDCD is a shell builtin[email protected]:/# type Lsls is hashed (/BIN/LS)
Linux command format:
COMMAND [OPTIONS ....] [ARGUMENTS ...]
Options: One or some of the features used to enable or disable commands
Short options:-C, for example:-l,-h
Multiple segment options can be used, such as-l,-h, to write-LH
Long options:--world, e.g.--long,--human-readable
Parameters: The Action object of the command to provide data to the command
Cancel command execution: Ctrl + C
File system:
Linux Learning--001