What are the Linux system commands
This article introduces the relevant knowledge of "what are the Linux system commands". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Linux commands are divided into internal commands and external commands:
Internal commands are called into memory when the system is started, and are resident in memory, so the execution efficiency is high.
The external command is the software function of the system, and the user only reads the memory from the hard disk when needed.
Type can be used to determine whether a command is a built-in command
Type: usage: type [- afptP] name [name. ]
[root@linuxeye ~] # type type
Type is a shell builtin
[root@linuxeye] # type-p type
[root@linuxeye] # type-t type
Builtin
[root@linuxeye ~] # type type
Type is a shell builtin
[root@linuxeye] # type-t type
Builtin
[root@linuxeye ~] # type pwd
Pwd is a shell builtin
[root@linuxeye ~] # type whiptail
Whiptail is / usr/bin/whiptail
[root@linuxeye] # type-t whiptail
File
Enable can not only view internal commands, but also determine whether they are internal commands.
[root@linuxeye ~] # enable-a # View internal commands
[root@linuxeye ~] # enable whiptail # non-internal command
-bash: enable: whiptail: not a shell builtin
[root@linuxeye ~] # enable pwd # is an internal command
Internal command user input when the system call rate is fast, not built-in commands, the system will read the environment variable file .bash _ profile, / etc/profile to find the PATH path.
Then when you mention the invocation of the command, some historical commands will exist in the hash table after they have been used, and the call to the command will be such a process when you type the command again.
The invocation of the hash-- "built-in command--" PATH command should actually be such a process.
[root@linuxeye ~] # type pwd
Pwd is a shell builtin
[root@linuxeye ~] # type cat
Cat is / usr/bin/cat
[root@linuxeye ~] # ls linuxeye*
Linuxeye.pem linuxeye.txt
[root@linuxeye ~] # cat linuxeye.txt
Linuxeye
[root@linuxeye ~] # hash-l # displays the hash table
Builtin hash-p / usr/bin/cat cat
Builtin hash-p / usr/bin/ls ls
[root@linuxeye ~] # type cat
Cat is hashed (/ usr/bin/cat)
[root@linuxeye ~] # hash-r # clear the hash table
[root@linuxeye ~] # type cat
Cat is / usr/bin/cat
As can be seen from the above operation. The hash table does not hold system built-in commands.
This is the end of the content of "what Linux system commands". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!