Linux??????ü???
???????????? ???????[ 2016/1/14 10:29:24 ] ??????????????
?????????
?????? Bash ???????man bash??????bash??????????????????????????????shell??У?????bash????????????????????????zsh??tsch????????????????????????
?????? vim ????Linux?£?????????????????????????????????????Emacs??Eclipse??????????????????????????vim??????? ??Vim??e?????????????????????Vim????????С???Vim??????????IDE??????
??????? ssh??????????????????????????ssh-agent?? ssh-add?????????sshFQ????scp??????ftp??????????????????scp ?????????????tab???????????????????????????????????????????????bash??????
???????bash???????????磺 &?? Ctrl-Z?? Ctrl-C?? jobs?? fg?? bg?? kill?? ????????????????Ctrl+??SIGQUIT????Ctrl+C ??SIGINT????????
??????????????? ?? ls ?? ls -l (?????? “ls -l” ?????е????)?? less?? head?? tail ?? tail -f?? ln ?? ln -s (?????????hard link??soft link???????????)?? chown?? chmod?? du (???????????????С du -sk *)?? df?? mount????????????????find??????
?????????????????? ip ?? ifconfig?? dig???????????????????netstat?? ping?? traceroute?? ??
????????????????????grep/egrep??????????磺 -o?? -A?? ?? -B ??Щ??????????????
????????? apt-get ?? yum ???????????????????????????Ubuntu????????????????Redhat??????????????????????????????
????????
?????? bash ????? Ctrl-R ?????????1???????????????
?????? bash????? Ctrl-W ?????????????????? Ctrl-U ???????С???man bash?????Readline Key Bindings?????????bash?????????????磺Alt-. ?????????????????????????????Alt-* ???г??????????????
???????????ε???????? cd – ?????home?? cd ~??
??????? xargs??????????????????????????-L??????ж???????????????-P????????е????????????????????????????????????????xargs echo????????????????????? -I{} ?????á?
?????????
????find . -name *.py | xargs grep some_function
????cat hosts | xargs -I{} ssh root@{} hostname
????pstree -p ??????????????????
??????? pgrep ?? pkill ?????????kill ???????????? (-f ????????).
?????????????????????????磺???????????????? kill -STOP [pid]. ??? man 7 signal ???????????????kill -l ?????????????????
??????? nohup ?? disown ?????????????????????????
???????netstat -lntp???????????????????????????????????????? lsof??
??????bash?????У????????? set -x ??debug???????? set -e ?????д??????????abort??С???????? set -o pipefail ??????????????????trap?????????????ctrl+c????
??????bash ????У?subshells (д??????????) ???????????????????Щ???????????????????????????????У????磺
????# do something in current dir
????(cd /some/other/dir; other-command)
????# continue in original dir
?????? bash ?У?????????к????????????磺
????????????????????: ${name:?error message}??
??????????bash???????????????????????????????? input_file=${1:?usage: $0 input_file}??
???????????????? i=$(( (i + 1) % 5 ))??
??????????У? {1..10}??
????????????????? ${var%suffix} ?? ${var#prefix}?? ????? if var=foo.pdf?? then echo ${var%.pdf}.txt prints “foo.txt”.
??????? <(some command) ?????????????????????????????????????????????? /etc/hosts?? diff /etc/hosts <(ssh somehost cat /etc/hosts)
??????????? “here documents” ???????? cat <<EOF ???????????
?????? bash?У????????????????????????磺 some-command >logfile 2>&1?????????????????а?????????????????????????????????????? “</dev/null”????/dev/null????????????
??????? man ascii ???? ASCII ???
?????????? ssh ??????? screen ?? dtach ???????????????ο???28??Unix/Linux????????????????
???????debug Web??????curl ?? curl -I ???? wget ???????debug Web????????firebug??curl??wget?????????????????
?????? HTML ???????? lynx -dump -stdin
??????????????XML????? xmlstarlet
???????? Amazon S3?? s3cmd ??????????????????е?????
?????? ssh?У????????????ssh???????? -L or -D (????-R) ??FQ??????
??????????????ssh ????????????磬.ssh/config ???????Щ?????????????????????????μ?host??????????????????????????????????????scp?????????
????TCPKeepAlive=yes
????ServerAliveInterval=15
????ServerAliveCountMax=6
????StrictHostKeyChecking=no
????Compression=yes
????ForwardAgent=yes
?????????????????????У???????????????????????????????????????????????????????????????????????????????????? Alt-# ??????????????????????#?????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11