Command type: built-in commands (shell built-in)
External commands (there is an executable file corresponding to the command name under a path in the file system)
External command search depends on the PATH variable
View the external command search path and the PATH variable:
[[Email protected] ~] # Echo $ path
/Usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: /root/bin
(Paths are separated)
Type: displays the type of the specified command.
[[Email protected] ~] # Type Su
Su is/bin/SU (external command)
Which: shows the full path of (Shell) commadns to view the command path
Which [Options] [--] programname [...]
[[Email protected] ~] # Which Su
/Bin/su
Get Command help
1) whatis command
[[Email protected] ~] # Whatis Su
SU (1)-run a shell with substitute user and group IDs
(1) indicates a chapter
2) Help: displays brief summaries of builtin commands
Internal Command: Help Command
External command: Command -- Help
[[Email protected] ~] # Su -- Help
Usage: su [Option]... [-] [user [parameter]...]
Change the valid tive user ID and group ID to that of user.
3) MAN (manual command manual)
Man command
Man is generally divided into eight chapters:
(1) user commands
(2) system call
(3) database call
(4) special files (hardware files)
(5) file format (Configuration File Syntax)
(6) games
(7) Miscellaneous (Miscellaneous)
(8) management commands
Man screen flip:
Flip back: Space
One screen forward: B
Flip One Line Backward: Enter
One row forward: K
Man search:
/Keyword: Search backward
? Keyword: Forward search
N: Next
N: Previous
Q: Exit man.
[[Email protected] ~] # Man Su
SU (1) user commands SU (1)
Name
Su-run a shell with substitute user and group IDs
Synopsis
Su [Option]... [-] [user [Arg]...]
4) online document: info command
5) Documentation:/usr/share/doc
Exercise:
1) whether ECHO is an internal command or an external command
[[Email protected] ~] # Type echo
ECHO is a shell builtin
ECHO is an internal command
2) Role
Echo --- display a line of text
3) The line feed shows "123456. abcdef"
[[Email protected] ~] # Echo-e "123456 \ nabcdef"
123456
Abcdef
Ii. Help