PWD Show current folder, ls View files under folder, CD into folder
-bash-4.2$ pwd
/home/myhaspl
-bash-4.2$ ls
ABC hadoop-2.4.1 mydoclist mypylst mypylsts numpy
Abd hadoop-2.4.1-src.tar.gz myl2 Mypylst1 myrun pypy-2.3.1-src
Error.log hadoop-2.4.1.tar.gz mylist mypylst2 myse SE
-bash-4.2$ CD NumPy
-bash-4.2$ ls
Bento_build.txt BUILD INSTALL.txt numpy runtests.py test_commit
Bento.info compatibility LICENSE.txt pavement.py setupegg.py THANKS.txt
Branding dev_readme.txt manifest.in README.txt setup.py Tools
Bscript Doc mydoclist release.sh site.cfg.example Tox.ini
-bash-4.2$
mkdir Creating a Folder
RM Delete File R-Reference indicates recursive deletion. Along with subfolders and their included deletions, F-parameters indicate forced deletion
-bash-4.2$ mkdir ABCD
-bash-4.2$ CD ABCD
-bash-4.2$ mkdir ABCD1
-bash-4.2$ CD ~
-bash-4.2$ ls
ABC hadoop-2.4.1 MYL2 MYPYLST2 numpy
ABCD hadoop-2.4.1-src.tar.gz mylist mypylsts pypy-2.3.1-src
Abd hadoop-2.4.1.tar.gz mypylst Myrun SE
Error.log mydoclist Mypylst1 Myse
-bash-4.2$ RM-RF ABCD
-bash-4.2$ ls
ABC hadoop-2.4.1 mydoclist mypylst mypylsts numpy
Abd hadoop-2.4.1-src.tar.gz myl2 Mypylst1 myrun pypy-2.3.1-src
Error.log hadoop-2.4.1.tar.gz mylist mypylst2 myse SE
-bash-4.2$
This blog all content is original, assume reprint please indicate sourcehttp://blog.csdn.net/myhaspl/
Vim Editor
$vim
After startup. Display interface
Simple operation. Press I to enter insert mode, enter character
Then press the ESC key to exit Insert mode, enter: wq! Hello, with "Hello" as the file name, save to exit.
-bash-4.2$ Cat Hello
Hello
world!
-bash-4.2$
Vim often uses the operation keys
Vim
Shortcut keys:
Ctags
File name
Do index
Cursor Movement:
Four Directions
K
H
0
L
J
Ctrl+f,
Ctrl+b
Page DOWN, PAGE up
Ctrl+d,
Ctrl+u
Half page DOWN, half page up
$
Move end of line
0
Move beginning
W
Move the next word
B
Move to the previous word
Gg
Jump to the beginning of the document
G
Jump to the end of the document
%
Jumps to the matching brackets ("{
}""[]""()")
Ctrl+i,tab
Skip to Next
Jump
Point
Ctrl+o
Skip to Previous
Jump
Point
23GG,
23G,
: 23
Jump to the first
23
Yes
Ctrl+i,
tab
Jumps to the next hop point (jump
Point)
Ctrl+o
Jump to last Hop point
Find Replacements:
#
Find the entire keyword backwards from the cursor
*
Find the entire keyword from the cursor forward
g#
Find keywords backwards from the cursor
g*
Find keywords from the cursor forward
Fx,tx,fx. Tx
Find characters in current line
Find a replacement sample:
:
S/search/replace
:
S/if/since
Replace the next "If" with "Since"
:
%s/if/since
Replace All "If" with "Since"
Word boundaries:
Specify word boundaries:
\<
And
\>
Such as:
/\<d[a-z]*an\>
Match to
D
Start with a random lowercase letter in the middle to
An
End of
Words
/\$[0-9]*\. [0-9] [0-9]
Match Lookup
$XX ... x.xx
That's the number, and there are only two small
Number of
Frequently used editing commands:
A
I
After the cursor is inserted,
Insert before the cursor
Dd
Delete a row
Cc,s
Delete a row and enter
Insert
Mode
Dw
Delete a word
cw
Delete a word and enter it
Insert
Mode
X,dl
Delete a character
S,cl
Delete a character after entering
Insert
Mode
P
Paste
Xp
Swap two characters
Ddp
Swap two lines
Y
Copy
Yy
Copy a row
U
Undo
Ctrl+r
Redo
.
Repeated last change
Ctrl+r
Redo
.
Repeated last change
Shell Basics,
Edit the shell file below and name the extension ". Sh"
-bash-4.2$ Cat test1.sh
#!/bin/sh
Ls-la
CD NumPy
Ls
-bash-4.2$ chmod A+rx test1.sh
-bash-4.2$./test1.sh
Mathematical pathways-distributed computing-linux/unix Technology Fundamentals (4)