Bash Common basic features (1)
Bash is a common shell, a recent interaction with the user:
command-line editing:
CTRL + A: Skip to the beginning of the command
Ctrl+e: Jump to the end of the command line
Ctrl+u: Delete the cursor to the beginning of the command line
CTRL+K: Delete the cursor to the end of the command line
CTRL+D: Delete cursor specified character
Ctrl+l: Clear Screen
History: Command Chronicle command
Option:-C: Empty command history
-D: Delete the command at the specified location
-W: Save command history to the. bash_history file
Common techniques:
!n: Executes the nth command in the command history;
!-n: Executes the reciprocal nth command in the command history;
!: Executes the previous command;
!string: The most recent command in the command history that starts with a specified string
!$/esc+./ALT +. : references the last parameter of the previous command;
3. Command and file path completion: Press the TAB key
4. FileName Wildcard related common skills
*: Represents any character of any length
?: Represents any single character
[]: Represents any single character in the specified range
[ABCD]: one of the characters that represents ABCD
[A-m]: represents one of the characters in A to M
[A-Z]: represents all lowercase letters as [: Lower:]
[A-Z]: represents all uppercase letters, as if [: Upper:]
[0-9]: Represents a number, as [:d Igit:]
[A-za-z]: represents uppercase and lowercase letters as [: Alpha:]
[0-9a-za-z]: represents numbers and uppercase and lowercase letters, as if [: Alnum:]
[: Space:]: white space character
[:p UNCT:]: Punctuation
[: Lower:]: lowercase letter, as [A-z]
[: Upper:]: Uppercase, as [A-z]
[: Alpha:]: Uppercase and lowercase letters, as [a-za-z]
[:d igit:]: number, as [0-9]
[: Alnum:]: Numbers and uppercase and lowercase letters, as if [0-9a-za-z]
[^]: matches any single character outside the specified range
If English is good, man 7 Glob View document
Example Description: File name wildcard:
Background Create W888,DE3,B1 good,1314,w.llow,x 66,9ay,520,d02i these several files
1. Show all files starting with 5 or W
LS [5w]*
2. Display all files that contain letters
LS *[a-za-z]*
3. Display files that contain only special characters
LS *[^[:alnum:]]*
LS *[^0-9a-za-z]*
This article is from the "Willow_xia" blog, make sure to keep this source http://willow.blog.51cto.com/6574604/1761997
Bash Common basic features (1)