systemctl control type service name
(start) start
(restart) Restart
(stop) to stop
(reload) reload
(status) to view the status
init 0 Close the current system
init 6 reboot the current system
(start) start
(restart) Restart
(stop) to stop
(reload) reload
(status) to view the status
init 0 Close the current system
init 6 reboot the current system
systemctl poweroff close the current system
systemctl reboot to restart the current system
systemctl reboot to restart the current system
Auxiliary operation command
tab key: complement an incomplete command or input path, if there are a plurality of the same path, the intention will not double-click operation
\: if the command entered is too long, the terminal may wrap, beautiful
Ctrl + U: before quickly delete the contents of the cursor
Ctrl + K: Quick delete the current cursor position to the end of the line all characters content
Ctrl + L: quickly clear the screen
Ctrl + C: cancel the current command and switch on a new line
Get command help
help: help command to view information about
man: -k [word] can see this word wrap command which
|: the results of the right post in the pipe symbol | action later processing
>: redirect the output result of the implementation of the right> back into the output file
Basic Operations directories and files
pwd: Displays the current working directory
[root @ node1 ~] # pwd
/ root
cd: switching working directory
[the root @ node1 ~] # cd / etc /
[the root @ node1 etc] # pwd
/ etc cd -: switching to a working directory cd ~: the cd command same cd: the current working directory. as a starting point cd ../: go back one working directory absolute path: root "/" as a starting point to the destination file path of fairly path: the current working directory to the target path of the file
[the root @ node1 ~] # cd / etc /
[the root @ node1 etc] # pwd
/ etc cd -: switching to a working directory cd ~: the cd command same cd: the current working directory. as a starting point cd ../: go back one working directory absolute path: root "/" as a starting point to the destination file path of fairly path: the current working directory to the target path of the file
ls: list (list) display the contents of the directory
-l: display information file and directories (permissions, size, last update time, etc. detail information) in a long format
[root @ node1 ~] # ls -l
total volume of 968
-rw-- . ----- 1 root root 1587 2018 7 Yue Anaconda-ks.cfg 21
-a: displays all information (All) subdirectories and files, including the name of the directory to hide files that start with "."
-A; and - a substantially similar effect, but there are two special hidden directory does not display the current directory, '..' represents the parent directory '.'
-d: province directory attribute display, instead of displaying the contents of a directory
-h: more humane way, the display size and the use of the directory files with the default -L (B) MB kB
-R & lt: recursively show all contents of the specified directory and its subdirectories
--color: character mode color-coded different files, if using --color = tty terminal using said predefined color scheme, normally, the directory dark blue, white general files, executable files indicates green, yellow indicates that the device file, and red for the compressed file
can use aliases ls commonly used settings operating
-l: display information file and directories (permissions, size, last update time, etc. detail information) in a long format
[root @ node1 ~] # ls -l
total volume of 968
-rw-- . ----- 1 root root 1587 2018 7 Yue Anaconda-ks.cfg 21
-a: displays all information (All) subdirectories and files, including the name of the directory to hide files that start with "."
-A; and - a substantially similar effect, but there are two special hidden directory does not display the current directory, '..' represents the parent directory '.'
-d: province directory attribute display, instead of displaying the contents of a directory
-h: more humane way, the display size and the use of the directory files with the default -L (B) MB kB
-R & lt: recursively show all contents of the specified directory and its subdirectories
--color: character mode color-coded different files, if using --color = tty terminal using said predefined color scheme, normally, the directory dark blue, white general files, executable files indicates green, yellow indicates that the device file, and red for the compressed file
can use aliases ls commonly used settings operating
du: Statistical directory and file space occupancy (Disk Usage)
-a: Statistics Disk space includes all files, not just the directory occupancy
-h: to follow the way of self-willed (KB default count, but does not display units) displays statistics,
-s: only statistical parameters occupied space for each size, not the size of each subdirectory statistics, file mkdir: create a new directory -p: create directories recursively
-a: Statistics Disk space includes all files, not just the directory occupancy
-h: to follow the way of self-willed (KB default count, but does not display units) displays statistics,
-s: only statistical parameters occupied space for each size, not the size of each subdirectory statistics, file mkdir: create a new directory -p: create directories recursively
touch: create an empty file
touch [filename]
touch [filename]
ln: create links file
format
ln -s to create a linked file absolute path to link to a file or directory
is created by default is a hard link
-s create a soft link
difference:
soft connection can view the source files
are equal and cp hard links, and modify linked files, source files can also be modified
hard link to delete the source files, linked files are still available
soft connection delete the source files, link files are not available
Note:
soft link can be connected across partitions, not hard links,
soft links connecting modify files in the source file changes, modify the source file, change connection files
cp: copy a file or directory
cp {} option source file or directory target file or directory
-f: covering the target file or directory of the same name is not to remind, force replication
-i: Overwrite same time to remind the user to files or directories (interactive)
-p: when kept covered, the source file permissions, owner and time stamp and other properties the same
-r: You must use this option to replicate the directory represents a recursively copy all the files and subdirectories
rm: delete a file or directory
rm file or directory
-f: not remind When you delete a file or directory, direct force the removal
-i: delete a file or directory to remind (interactive)
-r: delete the directory must use this to represent recursive delete the entire directory and subdirectories (with caution)
rm file or directory
-f: not remind When you delete a file or directory, direct force the removal
-i: delete a file or directory to remind (interactive)
-r: delete the directory must use this to represent recursive delete the entire directory and subdirectories (with caution)
rmdir: delete empty directories mv: move files or directories mv [options] source file or directory target file or directory mv source file name of the target file name which: View user perform a directory command files stored [root @ node1 a] # which ls LS = Alias 'LS = Auto --color' / usr / bin / LS [node1 the root @ A] #
whereis: See storage directory user command (in front of the storage path, man manual change commands stored in the rear storage position)
[the root @ node1 Data] # the whereis CP
CP: / usr / bin / CP / usr / Share / man / man1 / cp.1.gz /usr/share/man/man1p/cp.1p.gz
whatis: a brief description of the role of command
[root @ node1 the Data] # whatis cp
cp (1) - copy files and directories
[root @ node1 the Data] # whatis cp
cp (1) - copy files and directories
find: view the file or directory
find [Look] [conditional expression]
-name: Find the file name according to
find / -name "nginx"
find [Look] [conditional expression]
-name: Find the file name according to
find / -name "nginx"
-size: Find the target file size
find / a -size + 1024k
find / a -size + 1024k
-user: to find files belonging to the target, depending on whether the user
find / usr / local / -user nginx
find / usr / local / -user nginx
-type: the search by file type
f represents a normal file
d represents the directory
b fast device file
c character device file
[root @ node1 ~] # the Find / The -type b -a: representation and the former and the latter are true -o : Indicates conditions or the former and the latter set up any of the established locate: view the file (do not use the directory, the file you are looking directly added to) [root @ node1 ~] # the locate the httpd.conf (the newly created file to see less, ) /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak /usr/lib/tmpfiles.d/httpd.conf If you want to find the new files, updatedb updating the index database system indo: View command help