The order in which Linux commands are queried in the system
When you enter a command in the system, the query order of the system is
Classification of Linux commands
- Internal command: The command itself is stored in system memory and is part of the shell program, which is run inside the shell program and does not need to be added to run the program.
- External command: Because the command function is relatively large, it is not stored in memory when the system starts to load, and it is loaded into memory only when it is used.
Use the type command to query:
[[Email protected] app]# type echo
Echo is a shell builtin//indicates that the command is an internal command
[[Email protected] app]# type man
Man is hashed (/usr/bin/man)//indicates command for external command
Simple use of Linux commands
LS//Query directory information is tied to the terminal
[[email protected]/]# ls-//-l long format listing this directory information
Total 110
Drwxr-xr-x. 5 root root 4096 Jan 09:58 app
Drwxr-xr-x. 2 root root 4096 Jan 08:49 asdasd
[[email protected]/]# ls-a//-a show. Opening hidden files
. ASDASD boot etc lib64 misc opt sbin sys usr
.. . autofsck. Dbus home lost+found mnt proc SELinux testdir var
App bin Dev lib media net root srv tmp
[[email protected] sysconfig]# ls-dl//-d View details of the current directory
Drwxr-xr-x. 7 root root 4096 Jan 8 20:54.
[[email protected] sysconfig]# Ls-dli//-i Displays the inode number of the current file or directory
524289 Drwxr-xr-x. 7 root root 4096 Jan 8 20:54.
Enable//View internal commands of the system
[Email protected] sysconfig]# Enable-a | Wc-l//-a indicates that all current internal commands are displayed
61
- Alias//Shows how many aliases the current system has
[[email protected] sysconfig]# alias bieming= ' ls-l '//set alias to Bieming
Hash
[[email protected]/]# hash//Show all hash commands
Hits command
1/usr/bin/tty
[[email protected]/]# hash-l//-l Show all the details of the hash command
Builtin Hash-p/usr/bin/tty tty~~
CP//Copy a file or directory to another file or directory
[Email protected] app]# cp/etc/passwd/app/
[[email protected] app]# ls
passwd
[[email protected] app]# cp-r/etc/sysconfig/network-scripts//app///-r recursively copy directory and all internal content
[[email protected] app]# ls
Network-scripts passwd
- RM//delete files and directories
[[email protected] app]# RM-RF *//r Force delete F Delete Directory
MV//change file or directory commands or move files and directories
[Email protected]/]# MV yidong//app/
Touch//If the file is not changed, create a new file and change the timestamp of the file if it already exists
[[email protected] app]# Touch 111
- mkdir//Create a directory
[[email protected] app]# MKDIR-PV MULU1/MULU2/MULU3//-p One-time creation of multilevel directory-v display creation process
mkdir:created directory mulu1‘<br/>mkdir: created directory
mulu1/mulu2 '
mkdir:created directory ' MULU1/MULU2/MULU3 '
Input and output redirection
Query order, classification and basic usage of Linux commands in the system