Command line editing
Mac jump cursor control key is
ctrl + a # jumps to the command of line
Ctrl + e # skip to the end of the command line
Ctrl + u # cursor to the command to delete the contents of the first line
Ctrl + k # Delete command line cursor to the end of the content
Ctrl + l # clear screen
Command substitution
$ (Command): The command is a command to replace the sub-process the results of its
anti-quotation marks, under the wavy line, the replacement process for the command execution result in a sub-command: · command ·
Touch File - $ (DATE + % H-F-M-%%% S) .txt
echo "Directory of The Current IS $ (pwd)"
bash supports quotes:
··: Replace command
"": weak references, variable substitutions may be achieved
'': strong references, variable substitution is not complete
\ NNN NNN character octal value (1 to 3 octal value of the character)
\\ backslash
\ a Ctrl-G tones
\ b Ctrl-H backspace
\ f Ctrl-L Traveling feed
\ n Ctrl-J newline
\ r Ctrl-M ENTER
\ t Ctrl-I tab key
\ v ctrl-X horizontal tab
CHAR1-CHAR2: characters range from CHAR1 to CHAR2 specified, the specified range in the order of ASCII code basis, only small to large, not descending.
[CHAR *]: This is a specific setting up SET2 function specified character to repeat the same length as the SET1
[CHAR * REPEAT]: This is set SET2 specific function is repeated to set the designated character REPEAT until the number of times (the REPEAT figure 8 taken calculated binary system, starts at zero)
<>: Required
[]: matches any single character within the specified range
[az] # a to Z
LS [AM] * See File #
LS [AZ] *
...: can appear multiple times
|: is selected from a plurality
{ }: grouping
create a file
mkdir {1,3} {1,3} # 1 or. 3
Touch {1..3} {1..3}. 1 to #. 3
File name wildcard, globbing
*: Matches any character of any length
:? Any single character
[]: matches any single character within the specified range
[ABC], [AZ], [0-9], [0-9a-zA-the Z]
[: alnum :]: all the alphabetic characters and numbers
[: Alpha:]: all alphabetic characters
[: blank:]: all horizontal spaces
[: CNTRL:]: all control characters
[: digit for:]: All figures
[: Graph:]: All printable characters (without spaces)
[: Lower:]: all lowercase letters
[: print:]: all printable characters (including spaces)
[: punct:]: All punctuation characters
[: space:]: All horizontal and vertical space character
[: upper:]: all uppercase letters
[: xdigit:]: All 16 binary system of digital
[= CHAR =]: All characters (equal sign in the CHAR, on behalf comply with the specified you can customize character of)
Man. 7 glob #
[^]: matches any single character outside the specified range
Scroll:
Backward one screen: SPACE
turn a screen forward: b
turn back one row: ENRER
turned forward one row: k
Find:
/ KEYWORD: front to back, more press n
n: Next
N: previous
KEYWORD:? Since forward
q: quit