{"id":67,"date":"2021-11-10T19:12:31","date_gmt":"2021-11-10T11:12:31","guid":{"rendered":"https:\/\/www.666818.xyz\/?p=67"},"modified":"2023-04-19T14:15:28","modified_gmt":"2023-04-19T06:15:28","slug":"linux%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.wkv.cc\/index.php\/2021\/11\/10\/linux%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e6%95%b4%e7%90%86\/","title":{"rendered":"Linux\u5e38\u7528"},"content":{"rendered":"<h2>\n\u6587\u4ef6\u5904\u7406\u547d\u4ee4<\/h2>\n<h3>mkdir: \u521b\u5efa\u76ee\u5f55<\/h3>\n<p>-p : \u9012\u5f52\u7684\u521b\u5efa\u76ee\u5f55 \u4e5f\u5c31\u662f\u53ef\u4ee5\u521b\u5efa\u591a\u5c42\u76ee\u5f55<br \/>\n\u4e00\u6b21\u521b\u5efa\u591a\u4e2a\u76ee\u5f55\uff1a mkdir {a,b,c,d,e,f}<br \/>\n\u4e00\u6b21\u521b\u5efa a b c d e f\u591a\u4e2a\u76ee\u5f55\u3002<\/p>\n<h3>rmdir\uff1a\u5220\u9664\u4e00\u4e2a\u7a7a\u6587\u4ef6\u5939<\/h3>\n<h3>cp\uff1a\u590d\u5236\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939<\/h3>\n<p>-a =-pdr<br \/>\n-p \u540c\u65f6\u590d\u5236\u6587\u4ef6\u5c5e\u6027\uff0c\u6bd4\u5982\u4fee\u6539\u65e5\u671f<br \/>\n-d \u590d\u5236\u65f6\u4fdd\u7559\u6587\u4ef6\u94fe\u63a5<br \/>\n-r: \u590d\u5236\u6587\u4ef6\u5939\u65f6,\u9012\u5f52\u590d\u5236\u5b50\u6587\u4ef6\u5939<br \/>\n-l \u4e0d\u590d\u5236\uff0c\u800c\u662f\u521b\u5efa\u6307\u5411\u6e90\u6587\u4ef6\u7684\u94fe\u63a5\u6587\u4ef6\uff0c\u94fe\u63a5\u6587\u4ef6\u540d\u7531\u76ee\u6807\u6587\u4ef6\u7ed9\u51fa\u3002<\/p>\n<h3>note:\u53ef\u4ee5\u5728\u62f7\u8d1d\u7684\u540c\u65f6\u91cd\u547d\u540d<\/h3>\n<h3>mv\uff1a\u79fb\u52a8\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\uff0c\u53ef\u4ee5\u5728\u79fb\u52a8\u7684\u65f6\u5019\u91cd\u547d\u540d<\/h3>\n<h3>rm \uff1a\u5220\u9664\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939<\/h3>\n<p>-r\uff1a\u9012\u5f52\u5220\u9664<br \/>\n-f\uff1a\u5f3a\u5236\u5220\u9664 \u5373\u6ca1\u6709\u63d0\u9192<\/p>\n<h3>ls :\u67e5\u770b\u6587\u4ef6<\/h3>\n<p>-l \u4ee5\u5217\u8868\u5f62\u5f0f\u67e5\u770b<br \/>\n-h \u4ee5\u4e00\u79cd\u4eba\u6027\u5316\u7684\u65b9\u5f0f\u67e5\u770b\uff0c\u4e5f\u662f\u6587\u4ef6\u7684\u5927\u5c0f\u4ee5\u5408\u9002\u7684\u5355\u4f4d\u663e\u793a<br \/>\n-a \u67e5\u770b\u6240\u6709\u6587\u4ef6\uff0c\u5305\u62ec\u9690\u85cf\u6587\u4ef6<br \/>\n-i \u663e\u793a\u51fa\u6587\u4ef6\u7684i\u8282\u70b9\u53f7<\/p>\n<h3>touch \u6587\u4ef6\u540d\uff1a\u521b\u5efa\u6587\u4ef6 \u53ef\u4ee5\u4e00\u6b21\u521b\u5efa\u591a\u4e2a\u6587\u4ef6\uff0c\u4ee5\u7a7a\u683c\u9694\u5f00<\/h3>\n<h3>cat :\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<\/h3>\n<p>-n:\u5e26\u884c\u53f7<\/p>\n<h3>tac:\u53cd\u5411\u663e\u793a\u6587\u4ef6\u5185\u5bb9<\/h3>\n<h3>more\uff1a\u5206\u9875\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<\/h3>\n<p>\u8fdb\u5165\u6d4f\u89c8\u6a21\u5f0f\u540e\uff1a<br \/>\nf\u6216\u8005\u7a7a\u683c\uff1a\u4e0b\u4e00\u9875<br \/>\nenter\uff1a\u4e00\u884c\u4e00\u884c\u5f80\u4e0b\u7ffb<br \/>\nq:\u9000\u51fa<\/p>\n<h3>less:\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<\/h3>\n<p>\u7a7a\u683c\u7ffb\u9875<br \/>\n\u56de\u8f66\u6362\u884c<br \/>\npageup\uff1a\u4e0a\u4e00\u9875<br \/>\npagedown\uff1a\u4e0b\u4e00\u9875<br \/>\n\u4e0a\u7bad\u5934\uff1a\u5411\u4e0a\u7ffb<br \/>\n\u4e0b\u7bad\u5934\uff1a\u5411\u4e0b\u7ffb<br \/>\n\/\u641c\u7d22\u8bcd n\u5411\u4e0b\u627e<\/p>\n<h3>head -n \u6587\u4ef6\u540d :\u67e5\u770b\u6587\u4ef6\u524dn\u884c\u3002\u7f3a\u7701-n\u663e\u793a\u524d10\u884c<\/h3>\n<h3>tail -n \u6587\u4ef6\u540d \uff1a\u67e5\u770b\u6587\u4ef6\u7684\u672b\u5c3e\u51e0\u884c<\/h3>\n<p>-f :\u52a8\u6001\u663e\u793a\u6587\u4ef6\u672b\u5c3e\u5185\u5bb9<\/p>\n<h3>ln:\u94fe\u63a5\u547d\u4ee4<\/h3>\n<p>-s\u521b\u5efa\u8f6f\u8fde\u63a5<br \/>\n\u786c\u94fe\u63a5\u548ccp -p\u7684\u533a\u522b\u662f\u786c\u94fe\u63a5\u4f1a\u540c\u6b65\u66f4\u65b0<br \/>\n\u6e90\u6587\u4ef6\u5982\u679c\u4e22\u5931\uff0c\u786c\u94fe\u63a5\u4f9d\u7136\u5b58\u5728\u3002<br \/>\n\u786c\u94fe\u63a5\u548c\u6e90\u6587\u4ef6\u7684i\u8282\u70b9\u76f8\u540c\u3002<br \/>\n\u786c\u94fe\u63a5\u4e0d\u80fd\u5938\u5206\u533a\uff0c\u8f6f\u8fde\u63a5\u53ef\u4ee5\u8de8\u5206\u533a\u3002<br \/>\n\u786c\u94fe\u63a5\u4e0d\u53ef\u4ee5\u94fe\u63a5\u76ee\u5f55\uff0c\u94fe\u63a5\u53ef\u4ee5<br \/>\n\u8f6f\u8fde\u63a5\u6587\u4ef6\u5177\u6709\u7684\u6743\u9650\u662fugo\u90fd\u662frwx<\/p>\n<h2>\n\u6743\u9650\u7ba1\u7406\u547d\u4ee4<\/h2>\n<h3>chmod:\u4fee\u6539\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6743\u9650\uff0c\u53ea\u6709root\u548c\u6240\u6709\u8005\u53ef\u4ee5\u66f4\u6539<\/h3>\n<p>[{ugoa}{+-=}{rwx}] [\u6587\u4ef6\u6216\u76ee\u5f55]<br \/>\n[mode=421] [\u6587\u4ef6\u6216\u76ee\u5f55]<br \/>\n-R \u9012\u5f52\u4fee\u6539<br \/>\n\u6743\u9650\u7684\u6570\u5b57\u8868\u793a\uff1a<br \/>\nr-&gt;4<br \/>\nw-&gt;2<br \/>\nx-&gt;1<\/p>\n<p>\u4f8b\uff1achmod u+x a.txt<br \/>\nchmod g+w,o-r a.txt \/\/\u540c\u65f6\u505a\u591a\u4e2a\u6743\u9650\u7684\u4fee\u6539<br \/>\nchmod g=rwx a.txt<br \/>\nchmod 640 a.txt<br \/>\nchmod -R 777 testdir \/\/\u628a\u76ee\u5f55\u548c\u4e0b\u9762\u6240\u6709\u6587\u4ef6\u7684\u6743\u9650<\/p>\n<p>\u9488\u5bf9\u6587\u4ef6\u3000\u3000 \u3000\u3000\u3000\u3000 \u9488\u5bf9\u76ee\u5f55<br \/>\nr\u3000\u3000 \u8bfb\u6743\u9650 \u3000\u3000 \u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\u3000\u3000 \u53ef\u4ee5\u5217\u51fa\u76ee\u5f55\u4e2d\u7684\u5185\u5bb9<br \/>\nw \u3000 \u5199\u6743\u9650 \u3000\u3000 \u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u5185\u5bb9 \u3000\u3000 \u53ef\u4ee5\u5728\u76ee\u5f55\u4e2d\u521b\u5efa\u3001\u5220\u9664\u6587\u4ef6<br \/>\nx \u3000 \u6267\u884c\u6743\u9650 \u53ef\u4ee5\u6267\u884c\u6587\u4ef6 \u3000\u3000\u3000\u3000 \u53ef\u4ee5\u8fdb\u5165\u76ee\u5f55<\/p>\n<h3>chown:\u66f4\u6539\u6587\u4ef6\u6240\u6709\u8005\uff0c\u53ea\u6709root\u53ef\u4ee5\u66f4\u6539<\/h3>\n<p>chown root a.txt\/\/\u628aa.txt\u66f4\u6539\u4e3aroot\u6240\u6709<\/p>\n<h3>chgrp:\u66f4\u6539\u6240\u5c5e\u7ec4<\/h3>\n<p>chgrp lambrother fengjie \/\/\u628afengjie\u7684\u6240\u5c5e\u7ec4\u66f4\u6539\u4e3alambrother<\/p>\n<h3>umask -S:\u67e5\u770b\u521b\u5efa\u6587\u4ef6\u7684\u7f3a\u7701\u6743\u9650\uff0c\u5373\u9ed8\u8ba4\u6743\u9650<\/h3>\n<p>umask 023:\u4fee\u6539\u6587\u4ef6\u7684\u7f3a\u7701\u6743\u9650\u4e3a777-023=754\u3002\u5373rwxr-xr&#8211;<\/p>\n<h2>\n\u6587\u4ef6\u641c\u7d22\u547d\u4ee4<\/h2>\n<h3>find:\u641c\u7d22\u5236\u5b9a\u8303\u56f4\u5185\u7684\u6587\u4ef6<\/h3>\n<p>find [\u641c\u7d22\u8303\u56f4] [\u5339\u914d\u6761\u4ef6]<br \/>\n-name \u6309\u6587\u4ef6\u540d\u641c\u7d22<br \/>\n-iname \u6839\u636e\u6587\u4ef6\u540d\u67e5\u627e\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199<br \/>\n-size +n\u5927\u4e8e -n\u5c0f\u4e8e n\u7b49\u4e8e \u8fd9\u4e2an\u662f\u6570\u636e\u5757\uff0c\u5728Linux\u4e2d\u4e00\u4e2a\u6570\u636e\u5757\u662f512\u5b57\u8282\u5927\u5c0f<br \/>\n-user \u6839\u636e\u6240\u6709\u8005\u67e5\u627e<br \/>\n-group \u6839\u636e\u6240\u5c5e\u7ec4\u67e5\u627e<br \/>\n\u6839\u636e\u6587\u4ef6\u5c5e\u6027\u67e5\u627e\uff1a<br \/>\n-amin \u8bbf\u95ee\u65f6\u95f4 access<br \/>\n-cmin \u6839\u636e\u6587\u4ef6\u5c5e\u6027\u88ab\u4fee\u6539\u7684\u65f6\u95f4 change<br \/>\n-mmin \u6839\u636e\u6587\u4ef6\u5185\u5bb9\u88ab\u4fee\u6539\u7684\u65f6\u95f4 modify<br \/>\n\u4f8b\uff1a find \/etc -cmin -5 :\u67e5\u627e\/etc\u76ee\u5f55\u4e0b\u4e94\u5206\u949f\u5185\u88ab\u4fee\u6539\u8fc7\u5c5e\u6027\u7684\u6587\u4ef6\u548c\u76ee\u5f55<\/p>\n<p>-a \u4e24\u4e2a\u6761\u4ef6\u540c\u65f6\u6ee1\u8db3<br \/>\nfind \/etc -size +10 -a -size -50<br \/>\n-o \u4e24\u4e2a\u6761\u4ef6\u6ee1\u8db3\u4e00\u4e2a\u5373\u53ef<\/p>\n<p>-type<br \/>\nf \u6587\u4ef6 d \u76ee\u5f55 l\u8f6f\u8fde\u63a5\u6587\u4ef6<br \/>\n-inum \u6839\u636ei\u8282\u70b9\u67e5\u627e<\/p>\n<p>\u5bf9\u627e\u5230\u7684\u7ed3\u679c\u8fdb\u884c\u64cd\u4f5c<br \/>\n-exec\u6216\u8005-ok \u547d\u4ee4 {} \\;<br \/>\n\u4f8b\u5982\uff1a<br \/>\nfind \/etc -name init* -exec ls -l {} \\; \u5bf9\u627e\u5230\u7684\u6587\u4ef6\u540d\u6309\u5217\u8868\u67e5\u770b<\/p>\n<p>find \/etc -name init :\u641c\u7d22\u76ee\u5f55\/etc\u4e0b\u9762\u6240\u6709\u7684init\u6587\u4ef6\uff0c\u7cbe\u786e\u5339\u914d\uff0c\u5305\u62ec\u5b50\u76ee\u5f55\u4e2d\u7684init\u6587\u4ef6<br \/>\nfind \/ -size +204800 \u641c\u7d22\u5927\u4e8e100M\u7684\u6587\u4ef6<\/p>\n<h3>locate \u6587\u4ef6\u540d<\/h3>\n<p>(\u67e5\u627e\u901f\u5ea6\u975e\u5e38\u5feb\uff0c\u56e0\u4e3a\u5b83\u7ef4\u62a4\u4e86\u4e00\u4e2a\u6587\u4ef6\u5e93\u3002\u7f3a\u70b9\u5c31\u662f\u65b0\u5efa\u7acb\u7684\u6587\u4ef6\u6ca1\u6709\u5f88\u5feb\u6536\u5f55\u5230\u6587\u4ef6\u5e93)<\/p>\n<p>updatedb \u66f4\u65b0locate\u7684\u6587\u4ef6\u8d44\u6599\u5e93 \u6587\u4ef6\u8d44\u6599\u5e93\u4e0d\u6536\u5f55\/tmp\u4e0b\u7684\u6587\u4ef6<br \/>\n-i \u4e0d\u533a\u5206\u5927\u5c0f\u5199<\/p>\n<h3>which :\u67e5\u627e\u547d\u4ee4\u7684\u76ee\u5f55\u4ee5\u53ca\u522b\u540d<\/h3>\n<h3>whereis :\u641c\u7d22\u547d\u4ee4\u6240\u5728\u76ee\u5f55\u53ca\u5e2e\u52a9\u6587\u6863\u8def\u5f84\u3002<\/h3>\n<h3>grep:\u5728\u6587\u4ef6\u4e2d\u641c\u5bfb\u5b57\u7b26\u4e32\u5339\u914d\u7684\u884c\u5e76\u8f93\u51fa\uff0c\u591a\u4e2a\u6587\u4ef6\u4ee5\u7a7a\u683c\u9694\u5f00\u3002<\/h3>\n<p>-i\u4e0d\u533a\u5206\u5927\u5c0f\u5199<br \/>\n-v\u6392\u9664\u6307\u5b9a\u5b57\u7b26\u4e32<br \/>\n-E \u4ee5\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u65b9\u5f0f\u641c\u7d22<br \/>\n-F \u4ee5\u666e\u901a\u6587\u672c\u7684\u65b9\u5f0f\u641c\u7d22<br \/>\n-n \u663e\u793a\u641c\u7d22\u5230\u7684\u5185\u5bb9\u5728\u6587\u4ef6\u4e2d\u7684\u884c\u53f7\u3002<\/p>\n<h2>\u5e2e\u52a9\u547d\u4ee4<\/h2>\n<h3>man\uff1a\u67e5\u770b\u547d\u4ee4\u6216\u8005\u914d\u7f6e\u6587\u4ef6\u7684\u5e2e\u52a9\u4fe1\u606f<\/h3>\n<p>man \u547d\u4ee4\/\u914d\u7f6e\u6587\u4ef6<br \/>\n\u5728\u624b\u518c\u91cc\u9762\uff0c\u53ef\u4ee5\u8f93\u5165\/\u8981\u67e5\u627e\u7684str<br \/>\nman ls<br \/>\nman services<br \/>\nman fstab \/\/\u76f4\u63a5\u8f93\u5165\u914d\u7f6e\u6587\u4ef6\u7684\u540d\u5b57\uff0c\u800c\u4e0d\u9700\u8981\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84 \u91cd\u70b9\u67e5\u770bname\u9009\u9879\u548c\u914d\u7f6e\u6587\u4ef6\u7684\u683c\u5f0f\u3002<br \/>\n\u5982\u679c\u4e00\u4e2a\u547d\u4ee4\u5373\u4f7f\u547d\u4ee4\u53c8\u662f\u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u5e8f\u53f7\u8fdb\u884c\u533a\u5206\uff0c\u6bd4\u5982\uff1a<br \/>\nman 1 passwd \u67e5\u770b\u547d\u4ee4passwd\u7684\u5e2e\u52a9<br \/>\nman 5 passwd \u67e5\u770b\u914d\u7f6e\u6587\u4ef6passwd\u7684\u5e2e\u52a9<\/p>\n<h3>whatis \uff1a\u5f97\u5230\u547d\u4ee4\u7684\u7b80\u8981\u4fe1\u606f<\/h3>\n<h3>apropos \u914d\u7f6e\u6587\u4ef6\u540d\uff1a\u67e5\u770b\u914d\u7f6e\u6587\u4ef6\u7684\u7b80\u77ed\u4fe1\u606f<\/h3>\n<h3>help \uff1a\u67e5\u770bshell\u5185\u7f6e\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\u3002<\/h3>\n<p>shell\u5185\u7f6e\u547d\u4ee4\u662f\u6ca1\u6709\u547d\u4ee4\u8def\u5f84\u3002\u4e0d\u80fd\u4f7f\u7528man\u67e5\u770b\u5e2e\u52a9\u3002<\/p>\n<h2>\n\u7528\u6237\u7ba1\u7406\u547d\u4ee4<\/h2>\n<h3>useradd: \u6dfb\u52a0\u7528\u6237<\/h3>\n<p>useradd \u7528\u6237\u540d<\/p>\n<h3>passwd: \u4fee\u6539\u7528\u6237\u5bc6\u7801<\/h3>\n<p>passwd \u7528\u6237\u540d \u4e0d\u52a0\u7528\u6237\u540d\u76f4\u63a5\u66f4\u6539\u81ea\u5df1\u7684\u5bc6\u7801<\/p>\n<h3>who:\u67e5\u770b\u5f53\u524d\u7684\u8d26\u6237<\/h3>\n<p>\u663e\u793a\u7684\u683c\u5f0f\u4e3a\uff1a \u767b\u5f55\u7528\u6237\u540d \u767b\u5f55\u7ec8\u7aef\uff08tty:\u672c\u5730\u767b\u5f55 pts:\u8fdc\u7a0b\u7ec8\u7aef\uff09 \u767b\u5f55\u65f6\u95f4 ip\u5730\u5740<\/p>\n<p>w:\u67e5\u770b\u66f4\u8be6\u7ec6\u7684\u7528\u6237\u767b\u5f55\u4fe1\u606f\u3002<\/p>\n<h2>\n\u538b\u7f29\u89e3\u538b\u7f29\u547d\u4ee4<\/h2>\n<h3>\ngzip:<\/h3>\n<p>\u538b\u7f29\uff1agzip \u6587\u4ef6\u540d \u53ea\u80fd\u538b\u7f29\u6587\u4ef6\u4e0d\u80fd\u538b\u7f29\u76ee\u5f55\uff0c\u538b\u7f29\u5b8c\u6e90\u6587\u4ef6\u4e5f\u4e0d\u89c1\u4e86<br \/>\n\u89e3\u538b\u7f29\uff1agunzip\/gzip -d \u538b\u7f29\u5305\u540d\u79f0<\/p>\n<h3>tar:<\/h3>\n<p>-zcvf \u538b\u7f29\u540e\u6587\u4ef6\u540d \u6253\u5305\u7684\u76ee\u5f55 :\u751f\u6210.tar.gz\u6587\u4ef6 \u6ce8\uff1a\u8fd9\u4e2a\u547d\u4ee4\u5148\u7528tar\u5f52\u6863\uff0c\u7136\u540e\u628a\u5f52\u6863\u7684\u5305\u538b\u7f29\u6210.gz<br \/>\n-zxvf \u8981\u89e3\u538b\u7684\u6587\u4ef6\u540d \uff1a\u89e3\u538b\u7f29.tar.bz2\u7684\u6587\u4ef6<\/p>\n<p>-jcvf \u538b\u7f29\u540e\u7684\u6587\u4ef6\u540d \u6253\u5305\u7684\u76ee\u5f55\uff1a\u751f\u6210.tar.bz2 \u6ce8\uff1a\u8fd9\u4e2a\u547d\u4ee4\u5148\u7528tar\u5f52\u6863\uff0c\u7136\u540e\u628a\u5f52\u6863\u7684\u5305\u538b\u7f29\u6210.bz2<br \/>\n-jxvf \u8981\u89e3\u538b\u7684\u6587\u4ef6\u540d :\u89e3\u538b.tar.bz2\u7684\u6587\u4ef6<\/p>\n<h3>zip:<\/h3>\n<p>zip -r \u538b\u7f29\u751f\u6210\u7684\u6587\u4ef6\u540d \u8981\u538b\u7f29\u7684\u76ee\u5f55<br \/>\nzip \u538b\u7f29\u751f\u6210\u7684\u6587\u4ef6\u540d \u8981\u538b\u7f29\u7684\u6587\u4ef6\u3002<\/p>\n<h3>unzip:<\/h3>\n<p>unzip \u8981\u89e3\u538b\u7f29\u7684\u6587\u4ef6<\/p>\n<h3>bzip2:<\/h3>\n<p>bzip2 -k \u8981\u538b\u7f29\u7684\u6587\u4ef6\u540d -k\u9009\u9879\uff1a\u4fdd\u7559\u6e90\u6587\u4ef6<br \/>\nbunzip2 -k \u8981\u89e3\u538b\u7684\u6587\u4ef6\u540d -k\u9009\u9879\uff1a\u4fdd\u7559\u538b\u7f29\u5305<\/p>\n<h2>\u7f51\u7edc\u547d\u4ee4<\/h2>\n<h3>write \u7528\u6237\u540d<\/h3>\n<p>write:\u7ed9\u5728\u7ebf\u7528\u6237\u53d1\u9001\u4fe1\u606f\uff0c\u7528\u6237\u4e0d\u5728\u7ebf\u4e0d\u884c\u3002\u4ee5Ctrl+D\u4fdd\u5b58<\/p>\n<h3>wall:\u7ed9\u6240\u6709\u7528\u6237\u540d\u53d1\u9001\u4fe1\u606f<\/h3>\n<p>wall \u8981\u53d1\u9001\u7684\u4fe1\u606f<\/p>\n<h3>ping:\u6d4b\u8bd5\u7f51\u7edc\u8fde\u901a\u6027<\/h3>\n<p>ping ip\u5730\u5740<br \/>\n-c \u8981ping\u7684\u6b21\u6570<\/p>\n<h3>ifconfig:<\/h3>\n<p>\u76f4\u63a5\u56de\u8f66\u67e5\u770b\u5f53\u524d\u7f51\u5361\u4fe1\u606f<br \/>\nifconfig \u7f51\u5361\u540d ip\u5730\u5740 \u4e34\u65f6\u4fee\u6539\u7f51\u7edcip<br \/>\nifconfig th0:0 192.168.1.100 netmask 255.255.255.0<br \/>\n\u7ed9th0\u8fd9\u4e2a\u7f51\u5361\u65b0\u6dfb\u52a0\u4e00\u4e2aip<br \/>\nifconfig eth0:0 down<br \/>\nifconfig eth0:0 up<br \/>\nifdown th0<br \/>\n\u7981\u7528th0\u8fd9\u5757\u7f51\u5361<\/p>\n<p>ifup th0<br \/>\n\u5f00\u542fth0\u8fd9\u5757\u7f51\u5361<\/p>\n<h3>mail:\u90ae\u4ef6\u547d\u4ee4<\/h3>\n<p>mail \u8981\u53d1\u9001\u7684\u7528\u6237\u540d<br \/>\nmail \u76f4\u63a5\u56de\u8f66\uff1a\u67e5\u770b\u547d\u4ee4<br \/>\nhelp :\u67e5\u770b\u652f\u6301\u7684\u547d\u4ee4\u683c\u5f0f<br \/>\n\u8f93\u5165\u5e8f\u5217\u53f7\uff1a\u67e5\u770b\u90ae\u4ef6\u8be6\u7ec6\u5185\u5bb9<br \/>\nh: \u56de\u5230\u90ae\u4ef6\u5217\u8868<br \/>\nd \u5e8f\u5217\u53f7\uff1a\u5220\u9664\u5e8f\u5217\u53f7\u5bf9\u5e94\u7684\u90ae\u4ef6<\/p>\n<h3>last:\u7edf\u8ba1\u8ba1\u7b97\u673a\u6240\u6709\u7528\u6237\u767b\u5f55\u7684\u65f6\u95f4\u4fe1\u606f\uff0c\u4ee5\u53ca\u91cd\u542f\u4fe1\u606f<\/h3>\n<h3>lastlog:\u6240\u6709\u7528\u6237\u6700\u540e\u4e00\u6b21\u767b\u5f55\u7684\u65f6\u95f4<\/h3>\n<p>-u \u7528\u6237\u7684uid \u67e5\u770b\u6307\u5b9a\u7528\u6237\u7684\u767b\u5f55\u4fe1\u606f\u3002<\/p>\n<h3>traceroute:\u663e\u793a\u6570\u636e\u5305\u5230\u4e3b\u673a\u95f4\u7684\u8def\u5f84<\/h3>\n<p>traceroute \u8981\u63a2\u6d4b\u7684\u5730\u5740.<br \/>\n-n \u4f7f\u7528ip\u800c\u4e0d\u4f7f\u7528\u57df\u540d<\/p>\n<h3>nslookup :\u67e5\u770b\u57df\u540d\u5bf9\u5e94\u7684ip\u5730\u5740<\/h3>\n<p>nsloppup www.baidu.com\u67e5\u770b\u767e\u5ea6\u7684ip\u5730\u5740<\/p>\n<h3>netstat:\u663e\u793a\u7f51\u7edc\u76f8\u5173\u4fe1\u606f<\/h3>\n<p>-t :tcp\u534f\u8bae<br \/>\n-u :udp\u534f\u8bae<br \/>\n-l:\u76d1\u542c<br \/>\n-r:\u8def\u7531<br \/>\n-n:\u663e\u793aip\u5730\u5740\u548c\u7aef\u53e3\u53f7<\/p>\n<p>netstat -tlun:\u67e5\u770b\u672c\u673a\u76d1\u542c\u7684\u7aef\u53e3<br \/>\nnetstat -an:\u67e5\u770b\u6240\u6709\u7684\u76d1\u542c\u4fe1\u606f<br \/>\nnetstat -rn \uff1a\u67e5\u770b\u8def\u7531\u8868\uff0c\u5373\u7f51\u7ba1<\/p>\n<h3>wget \u6587\u4ef6\u5730\u5740<\/h3>\n<p>\u4e0b\u8f7d\u6587\u4ef6<\/p>\n<h3>service network restart:\u91cd\u542f\u7f51\u7edc\u670d\u52a1<\/h3>\n<h3>telnet \u57df\u540d\u6216ip<\/h3>\n<p>\u8fdc\u7a0b\u7ba1\u7406\u4e0e\u7aef\u53e3\u63a2\u6d4b<br \/>\n\u5982\uff1a telnet 192.168.2.3:80<br \/>\n\u63a2\u6d4b192.168.2.3\u662f\u5426\u5f00\u542f\u4e8680\u7aef\u53e3<\/p>\n<h3>mount:\u6302\u8f7d\u547d\u4ee4<\/h3>\n<p>mount -t iso9660 \/dev\/sr0 \/mnt\/cdrom :\u628asr0\u6302\u5728\u5230cdrom<\/p>\n<h2>\u5173\u673a\u91cd\u542f\u547d\u4ee4<\/h2>\n<h3>shutdown:\u8fd9\u4e2a\u5173\u673a\u547d\u4ee4\u66f4\u5b89\u5168\u4e00\u4e9b\uff0c\u4e0d\u63a8\u8350\u4f7f\u7528\u5176\u4ed6\u5173\u673a\u547d\u4ee4\u3002<\/h3>\n<p>-h\uff1a\u5173\u673a<br \/>\nshutdown -h now shutdown -h 20:30<br \/>\n-r:\u91cd\u542f<br \/>\nshutdown -r now<br \/>\n-c:\u53d6\u6d88\u4e0a\u6b21\u7684\u5173\u673a\u547d\u4ee4<\/p>\n<p>\u91cd\u542f\uff1a<br \/>\ninit 6<br \/>\nreboot<\/p>\n<p>\u5173\u673a\uff1a<br \/>\ninit 0<br \/>\npoweroff<\/p>\n<p>\u7cfb\u7edf\u8fd0\u884c\u7ea7\u522b\uff1a<br \/>\n0 \u5173\u673a<br \/>\n1 \u5355\u7528\u6237 \u7c7b\u4f3cwindows\u5b89\u5168\u6a21\u5f0f<br \/>\n2 \u4e0d\u5b8c\u5168\u591a\u7528\u6237\uff0c\u4e0d\u542bnfs\u670d\u52a1<br \/>\n3 \u5b8c\u5168\u591a\u7528\u6237<br \/>\n4 \u672a\u5206\u914d<br \/>\n5 \u56fe\u5f62\u754c\u9762<br \/>\n6 \u91cd\u542f<br \/>\n\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\/etc\/inittab\u6765\u67e5\u770b\u7cfb\u7edf\u542f\u52a8\u7684\u8fd0\u884c\u7ea7\u522b<br \/>\nrunlevel:\u67e5\u770b\u5f53\u524d\u7684\u8fd0\u884c\u7ea7\u522b<br \/>\ninit n:\u8bbe\u7f6e\u7cfb\u7edf\u8fd0\u884c\u7ea7\u522b<\/p>\n<h3>logout:\u9000\u51fa\u5f53\u524d\u7528\u6237\uff0c\u8fd4\u56de\u5230\u767b\u5f55\u754c\u9762<\/h3>\n<h2>\n\u5176\u4ed6\u547d\u4ee4<\/h2>\n<h3>du -sh \u6587\u4ef6\u540d<\/h3>\n<h3>ps: \u9759\u6001\u67e5\u770b\u7cfb\u7edf\u8fdb\u7a0b\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u5b89\u88c5<\/h3>\n<p>ps -aux \u4f7f\u7528BSD\u8bed\u6cd5\u67e5\u770b\u6240\u6709\u8fdb\u7a0b<br \/>\nps -ef \u6807\u51c6\u8bed\u6cd5\u67e5\u770b\u6240\u6709\u8fdb\u7a0b<br \/>\nUID \u7a0b\u5e8f\u88ab\u8be5 UID \u6240\u62e5\u6709<br \/>\nPID \u5c31\u662f\u8fd9\u4e2a\u7a0b\u5e8f\u7684 ID<br \/>\nPPID \u5219\u662f\u5176\u4e0a\u7ea7\u7236\u7a0b\u5e8f\u7684ID<br \/>\nC CPU \u4f7f\u7528\u7684\u8d44\u6e90\u767e\u5206\u6bd4<br \/>\nSTIME \u7cfb\u7edf\u542f\u52a8\u65f6\u95f4<br \/>\nTTY \u767b\u5165\u8005\u7684\u7ec8\u7aef\u673a\u4f4d\u7f6e<br \/>\nTIME \u4f7f\u7528\u6389\u7684 CPU \u65f6\u95f4\u3002<br \/>\nCMD \u6240\u4e0b\u8fbe\u7684\u6307\u4ee4\u4e3a\u4f55<br \/>\nps -aux &#8211;sort -pcpu,-pmem<br \/>\n\u6839\u636eCPU\u5360\u7528\u60c5\u51b5\u548c\u5185\u5b58\u5360\u7528\u60c5\u51b5\u6765\u663e\u793a\u8fdb\u7a0b<br \/>\nwatch -n 1 &#8216;ps -aux &#8211;sort -pcpu,-pmem&#8217;<br \/>\n\u6bcf\u96941\u79d2\u76d1\u63a7\u4e00\u6b21\u8fdb\u7a0b\u60c5\u51b5<\/p>\n<h3>top: \u52a8\u6001\u67e5\u770b\u7cfb\u7edf\u7684\u72b6\u6001<\/h3>\n<h3>lsof -Pti :8000\u901a\u8fc7\u7aef\u53e3\u53f7\u83b7\u5f97\u8fdb\u7a0bpid<\/h3>\n<h3>kill -9 pid\u6740\u6b7b\u6307\u5b9apid\u7684\u8fdb\u7a0b\uff0c\u5f3a\u884c\u6740\u6b7b<\/h3>\n<h3>history<\/h3>\n<p>\u67e5\u770b\u5386\u53f2\u547d\u4ee4<\/p>\n<p>\u6267\u884c\u5386\u53f2\u547d\u4ee4<\/p>\n<p>!! \u6267\u884c\u4e0a\u4e00\u6761\u547d\u4ee4<br \/>\n!n \u6267\u884c\u5386\u53f2\u547d\u4ee4\u7684\u4e2d\u7b2cn\u6761<br \/>\n!-n \u6267\u884c\u5bfc\u6570\u7b2cn\u6761<br \/>\n!string \u6267\u884c\u4ee5string\u5f00\u5934\u7684\u5386\u53f2\u547d\u4ee4\u884c<br \/>\n!?string? \u6267\u884c\u5305\u542bstring\u7684\u5386\u53f2\u547d\u4ee4\u884c<\/p>\n<h3>alias<\/h3>\n<p>\u7ed9\u547d\u4ee4\u8d77\u522b\u540d<\/p>\n<p>alias \u547d\u4ee4=&#8217;\u522b\u540d&#8217;<br \/>\nalias -p \u67e5\u770b\u5df2\u5b58\u5728\u7684\u522b\u540d<\/p>\n<h3>unlias<\/h3>\n<p>\u53d6\u6d88\u522b\u540d<br \/>\nunlias name<\/p>\n<h3>cal<\/h3>\n<p>\u67e5\u770b\u67d0\u4e00\u5e74\u7684\u65e5\u5386\uff0c\u53ef\u4ee5\u662f1-9999\u4e2d\u7684\u4efb\u610f\u4e00\u5e74<br \/>\ncal 88<\/p>\n<h3>zcat<\/h3>\n<p>\u67e5\u770b\u538b\u7f29\u5305\u4e2d\u7684\u5185\u5bb9<\/p>\n<h3>sed -i &#8216;s#old#new#g&#8217; \u6587\u4ef6\u540d<\/h3>\n<p>\u4f7f\u7528new\u66ff\u6362\u6587\u4ef6\u4e2d\u7684old<\/p>\n<h3>ssh root@192.168.8.15 &#8220;ifconfig&#8221;<\/h3>\n<p>\u8fdc\u7a0b\u6267\u884c\u547d\u4ee4<\/p>\n<h3>bash -x \u811a\u672c\u540d<\/h3>\n<p>\u8c03\u8bd5\u811a\u672c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u4ef6\u5904\u7406\u547d\u4ee4 mkdir: \u521b\u5efa\u76ee\u5f55 -p : \u9012\u5f52\u7684\u521b\u5efa\u76ee\u5f55 \u4e5f\u5c31\u662f\u53ef\u4ee5\u521b\u5efa\u591a\u5c42\u76ee\u5f55 \u4e00\u6b21\u521b\u5efa\u591a\u4e2a\u76ee\u5f55\uff1a m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-biancheng","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":3,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/posts\/67\/revisions\/189"}],"wp:attachment":[{"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wkv.cc\/index.php\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}