Linux Command classification
Internal command: belongs to Shell interpreter
External command: independent of Shell interpreter
Check command type
Type: Check the types of command words
[[Email protected] ~]# type ls
LS is an alias of ' LS--color=auto '
————————————————————————
Type meaning
Builtin commands created inside the shell
file disk files, external commands
Alias Command aliases
Keyword reserved keywords
function Shell functions
Not found not found, unrecognized
——————————————————————————
Man xxx See more help
Press G to scroll to the beginning
Press G to scroll to the end
Uppercase N jump up match
lowercase n jumps down
Enter/x to find this option for-X
——————————————————————————
Ls
Format: LS-[option] [directory or file name]
-L: Display in long format
-A: Shows hidden directories. The other is the same as-a
-D: Show the directory itself instead of the content
-H: Provides easy-to-read capacity units
-R: Recursive display of content
——————————————————————————
Alias: Create your own commands
Alias xx= ' LS-LHD '
Unalias XX Delete the command you created XX
——————————————————————————
Du
Format: du-[Options] [directory or file]
Common Command options:
-A: Statistics all files, not only statistics directory
-S: Count only the total amount of space that is given to a parameter
-H: Provides easy-to-read capacity units (K m, etc.)
[Email protected] Desktop]# du-sh/boot//etc/pki/
116m/boot/
1.5m/etc/pki
———————————————————————————
mkdir: Creating a Folder
Format: mkdir [file name] [/path/] Directory name
-P: Continuous creation of directories
[[Email protected] Desktop]# Mkdir/root/hydra
———————————————————————————
Touch: Create a text file
Format: Touch file name
[email protected] ~]# Touch xxx.txt
———————————————————————————
MV: Move/rename (path unchanged is renamed)
Format: MV-[option] Original file destination path
-F: Do not prompt
[[email protected] ~]# Touch 1.txt
[Email protected] ~]# mkdir 1
[[email protected] ~]# Touch 1.txt
[[email protected] ~]# ls
1 anaconda-ks.cfg initial-setup-ks.cfg template picture Download desktop
1.txt help.php Public Video document music
[Email protected] ~]# MV/ROOT/1.TXT/ROOT/1
[[email protected] ~]# ls
1 help.php Public video document music
anaconda-ks.cfg initial-setup-ks.cfg template Picture Download desktop
————————————————————————————————————
RM: Delete
Format: RM-[option] file or directory
Common Command options:
-r: Recursively delete entire Directory
-F: Forced delete, not prompt (vs. i)
[Email protected] ~]# RM-RF xxx.txt
——————————————————————————————————
Ln-s Creating a Connection file
Format: LN [-S] Source File connection file path
[[email protected] ~]# cat/etc/redhat-release (source file)
Red Hat Enterprise Linux Server Release 7.2 (MAIPO)
[[email protected] ~]# ln-s/etc/redhat-release/xx (Connect source file path and create shortcut)
[Email protected] ~]# ls/xx
/xx
[Email protected] ~]# ls-l/xx
lrwxrwxrwx. 1 root root 19 May 14:50/xx-/etc/redhat-release
[Email protected] ~]#
————————————————————————————————————————————
CP: Copy
Format: CP-[option] Original file destination path
Common Command options:
-r: Recursively copy entire Directory
-F: Forced override
-P: Keep the properties of the original file unchanged
[Email protected]/]# cp-rfp/home/anonymous/boot/
[Email protected]/]# cd/boot/
[[email protected] boot]# ls
Anonymous
————————————————————————————————————————————---
Linux Foundation II