mkdir -p da/db/dc
mkdir directory
rm -rf
rmdir directory
command;command2;command3
command1;sleep 10;command3
echo "command1;sleep 10;command3" >>main.c
cp -r da dc:r -recursive
-i:indication
rm -rf :remove -recursive -force
rmdir : remove directory
rm : remove file
rm -f !(main.c):except main.c
find . -not -name "mian.c" -exec rm -rf {} \;
ls -F:-
format
echo *.c
ls *.c
rm *.c
?:one character
*:any character
ls f?
ls f[a-c]
ls f[123abcd]
echo f[4-12]:f[4-1] or f[2]
cat file:
more file:(q:quit)
less file:
head -5 file:show the first 5 lines
tail -3 file:show the last 3 lines
wc file:word count
wc -l file:line count
grep keywords file:search keywords
grep -i keywords file:ignore uppercase or lowcase
grep -v keywords file:search without keywords
cmd 1|cmd 2:cmd1's result is the parameter of cmd 2
eg:grep main|more
vim
H:first line
L:last line
M:middle line
ctrl+f:forword
ctrl+b:backspace
:number :locate no. line
number G:no. line go
G:go to end of file
G1:the first line of the file
w:next word
b:previous word
e:word end
set nu //show the line number
set nonu:
I:input at the start of line(Insert)
A:intput ar the end of line(Append)
O:insert a line up;(ON)
x:delete character
5x:delete 5 character
u:undo
p:ctrl+z
P:paste
dw:delete word
de:delete to end word
dd:delete line
d$:from curser to the start of line
8,11 m 18 line:move
8,11 co 18 line:copy
yl:copy
yw:copy word
yy:copy the whole line
3yy:3 lines
r key:replace
cw:
~:change uppercase and lowercase
J:conjuction
/key :search forward key
n:next
?key:search previous
$:sign of the last
%:the whole paper
x:save and exit
telnet
find directory condition [cmd] -- print
eg:
find . -name "f*"
find . -name "*.cpp"
find dir1 condition -exec cp {} target dir2 \;
{} :the file that find
\; escape sequence :the sign of cmd over;
eg:
find /home/user/project -name "*.c" -exec cp {} /home/user \;
who:show anybody who on this machine
users:
whoami:
w:who where when do what
history:show history cmd
!number:run the cmd again
du:
Network
ping IP
ifconfi -a
FTP
ls:show ftp
!ls :show local
lcd :local change dir
put:upload files
get:download
mput/mget:multiply put/get
mkdir :make dir
bye:exit
help:show all cmds
env:environment
echo "$PATH"
PATH = $PATH:.
:delimiter
whereis cmd :search cmd location
which cmd:
vim my.sh
echo hello world
sleep 10
echo $USER
echo date
source my.sh = ./my.sh