{"id":100,"date":"2021-01-18T11:37:41","date_gmt":"2021-01-18T03:37:41","guid":{"rendered":"http:\/\/blog.ppdd.vip\/?p=100"},"modified":"2021-01-18T11:37:41","modified_gmt":"2021-01-18T03:37:41","slug":"%e5%ad%a6%e4%b9%a0linux%e5%91%bd%e4%bb%a4%ef%bc%8c%e7%9c%8b%e8%bf%99%e7%af%872w%e5%a4%9a%e5%ad%97%e7%9a%84%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3%e5%b0%b1%e5%a4%9f%e4%ba%86","status":"publish","type":"post","link":"https:\/\/blog.ppdd.vip\/index.php\/2021\/01\/18\/%e5%ad%a6%e4%b9%a0linux%e5%91%bd%e4%bb%a4%ef%bc%8c%e7%9c%8b%e8%bf%99%e7%af%872w%e5%a4%9a%e5%ad%97%e7%9a%84%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3%e5%b0%b1%e5%a4%9f%e4%ba%86\/","title":{"rendered":"\u5b66\u4e60linux\u547d\u4ee4\uff0c\u770b\u8fd9\u7bc72w\u591a\u5b57\u7684\u547d\u4ee4\u8be6\u89e3\u5c31\u591f\u4e86"},"content":{"rendered":"<p>\u5e8f\u8a00<br \/>\n\u2003\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u8bb2\u89e3\u4e86\u4e00\u4e9blinux\u5e38\u7528\u547d\u4ee4\uff0c\u4e3b\u8981\u8bb2\u89e3\u6a21\u5f0f\u662f\uff0c\u547d\u4ee4\u4ecb\u7ecd\u3001\u547d\u4ee4\u53c2\u6570\u683c\u5f0f\u3001\u547d\u4ee4\u53c2\u6570\u3001\u547d\u4ee4\u5e38\u7528\u53c2\u6570\u793a\u4f8b\u3002\u7531\u4e8elinux\u547d\u4ee4\u8f83\u591a\uff0c\u6211\u8fd8\u7279\u610f\u9009\u4e86\u4e00\u4e9b\u65e5\u5e38\u4f7f\u7528\u8f83\u4e3a\u9891\u7e41\u7684\u547d\u4ee4\u8fdb\u884c\u8bb2\u89e3\uff0c\u4f46\u8fd8\u662f\u514d\u4e0d\u4e86\u6587\u7ae0\u5f88\u957f\uff0c\u5efa\u8bae\u5927\u5bb6\u6536\u85cf\u8d77\u6765\uff0c\u7528\u5230\u7684\u65f6\u5019\u4e0d\u4f1a\u4e86\u518d\u6765\u9605\u8bfb\u3002\u5f53\u7136\u5b66\u4e60linux\u547d\u4ee4\u6700\u597d\u7684\u65b9\u6cd5\u662f\u5b66\u4f1a\u4f7f\u7528linux\u81ea\u5e26\u7684man\u624b\u518c\uff0c\u6240\u6709linux\u547d\u4ee4\u89c4\u8303\u548c\u4f7f\u7528\u7ec6\u5219\u90fd\u4f1a\u5728\u8be5\u624b\u518c\u4e2d\u8bb2\u89e3\u7684\u5f88\u6e05\u695a\uff0c\u6211\u5728\u4e66\u5199\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u662f\u53c2\u8003\u8be5\u624b\u518c\u548c\u65e5\u5e38\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>\u5982\u679c\u8fd8\u6709\u54ea\u4e9b\u662f\u5927\u5bb6\u5e0c\u671b\u518d\u8865\u5145\u7684\u547d\u4ee4\uff0c\u53ef\u4ee5\u7559\u8a00\u7ed9\u6211\uff0c\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u8be5\u6587\u7ae0\uff0c\u540c\u65f6\u4e5f\u4f5c\u4e3a\u6211\u5b66\u4e60\u548c\u5de5\u4f5c\u7684\u624b\u518c\u3002<\/p>\n<p>Linux\u521d\u7ea7\u6307\u4ee4<br \/>\nls \u2014\u2014List<br \/>\nls \u4ecb\u7ecd<br \/>\n\u2003\u8fd9\u662f\u6211\u5b66Linux\u7684\u7b2c\u4e00\u4e2a\u547d\u4ee4\uff0c\u76f8\u4fe1\u4e5f\u662f\u5f88\u591a\u4eba\u5b66\u4e60Linux\u7684\u7b2c\u4e00\u4e2a\u547d\u4ee4\u3002ls\u5168\u79f0list.<\/p>\n<p>List information about the FILEs (the current directory by default).  Sort entries alphabetically if none of -cftuvSUX nor &#8211;sort is specified.<\/p>\n<p>\u5217\u51fa\u6709\u5173\u6587\u4ef6\u7684\u4fe1\u606f(\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55)\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a-cftuvSUX\u6216\u2014\u2014Sort\uff0c\u5219\u6309\u5b57\u6bcd\u987a\u5e8f\u6392\u5e8f\u3002<\/p>\n<p>\u2003\u5b98\u65b9\u7684\u8bf4\u7684\u5f88\u6e05\u695a\uff0c\u9ed8\u8ba4\u5217\u51fa\u5f53\u524d\u76ee\u5f55\uff0c\u6240\u4ee5\u53ef\u4ee5\u5217\u51fa\u5176\u4ed6\u76ee\u5f55\u6216\u8005\u8def\u5f84\u4e0b\u7684\u6587\u4ef6\u4fe1\u606f\u6216\u8005\u76ee\u5f55\u4fe1\u606f\u3002<\/p>\n<p>eg\uff1a<\/p>\n<p>$ls \/etc\/hosts<br \/>\n\/etc\/hosts<br \/>\n\u2003ls\u8fd8\u53ef\u4ee5\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5217\u8868\u3002<\/p>\n<p>\u56fe\u7247<br \/>\nimage-20191221161638964<br \/>\nls \u53c2\u6570\u683c\u5f0f<br \/>\nls [OPTION]&#8230; [FILE]&#8230;<\/p>\n<p>ls\u547d\u4ee4\u53c2\u6570<br \/>\n-a  \u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\uff0c\u5305\u62ec\u9690\u85cf\u6587\u4ef6<\/p>\n<p>-c \u4f7f\u7528\u6700\u540e\u4e00\u6b21\u66f4\u6539\u6587\u4ef6\u72b6\u6001\u4ee5\u8fdb\u884c\u6392\u5e8f(-t)\u6216\u957f\u65f6\u95f4\u6253\u5370(-l)\u7684\u65f6\u95f4<\/p>\n<p>-h \u4e0e-l\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u65f6\uff0c\u8bf7\u4f7f\u7528\u5355\u4f4d\u540e\u7f00:Byte\u3001Kilobyte\u3001mete\u3001gb\u3001tb\u548cPetabyte\uff0c\u4ee5\u4fbf\u4f7f\u7528\u4ee52\u4e3a\u57fa\u6570\u7684\u5927\u5c0f\u5c06\u6570\u5b57\u51cf\u5c11\u52303\u6216\u66f4\u5c11<\/p>\n<p>-l \u957f\u683c\u5f0f\u5217\u8868\u3002(\u89c1\u4e0b\u6587)\u3002\u5982\u679c\u8f93\u51fa\u5230\u7ec8\u7aef\uff0c\u5219\u6240\u6709\u6587\u4ef6\u5927\u5c0f\u7684\u603b\u548c\u5c06\u8f93\u51fa\u5230\u957f\u6e05\u5355\u524d\u9762\u7684\u4e00\u884c\u4e2d<\/p>\n<p>-n \u4ee5\u6570\u5b57\u5f62\u5f0f\u663e\u793a\u7528\u6237\u548c\u7ec4id\uff0c\u800c\u4e0d\u662f\u5728\u957f(-l)\u8f93\u51fa\u4e2d\u8f6c\u6362\u4e3a\u7528\u6237\u6216\u7ec4\u540d\u3002\u8fd9\u4e2a\u9009\u9879\u9ed8\u8ba4\u6253\u5f00-l\u9009\u9879<\/p>\n<p>-o \u4ee5\u957f\u683c\u5f0f\u5217\u51fa\uff0c\u4f46\u7701\u7565\u7ec4id<\/p>\n<p>-s \u663e\u793a\u6bcf\u4e2a\u6587\u4ef6\u5b9e\u9645\u4f7f\u7528\u7684\u6587\u4ef6\u7cfb\u7edf\u5757\u7684\u6570\u91cf\uff0c\u4ee5512\u5b57\u8282\u4e3a\u5355\u4f4d\uff0c\u5176\u4e2d\u90e8\u5206\u5355\u5143\u56db\u820d\u4e94\u5165\u4e3a\u4e0b\u4e00\u4e2a\u6574\u6570\u503c<\/p>\n<p>-t \u5728\u6309\u7167\u5b57\u5178\u987a\u5e8f\u5bf9\u64cd\u4f5c\u6570\u6392\u5e8f\u4e4b\u524d\uff0c\u5148\u6309\u4fee\u6539\u7684\u65f6\u95f4\u6392\u5e8f(\u6700\u8fd1\u4fee\u6539\u7684\u662ffirst)<\/p>\n<p>-u \u4f7f\u7528\u6700\u540e\u4e00\u6b21\u8bbf\u95ee\u7684\u65f6\u95f4\uff0c\u800c\u4e0d\u662f\u6700\u540e\u4e00\u6b21\u4fee\u6539\u6587\u4ef6\u8fdb\u884c\u6392\u5e8f<\/p>\n<p>ls \u7528\u6cd5\u793a\u4f8b\uff1a<br \/>\n$ ls<br \/>\ntest  tmp<br \/>\n$ ls -a<br \/>\n.  ..  .bash_history  .bash_logout  .bash_profile  .bashrc  test  tmp<\/p>\n<h1>\u53ef\u4ee5\u770b\u5230\u901a\u8fc7ls -a \u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u5f71\u85cf\u7684\u6587\u4ef6\uff0cLinux\u4e0b(.)\u5f00\u5934\u7684\u6587\u4ef6\u662f\u9690\u85cf\u6587\u4ef6\u3002<\/h1>\n<p>$ ls -l<br \/>\ntotal 4<br \/>\n-rw-r&#8211;r&#8211; 1 test hero    0 Dec 21 19:54 test<br \/>\ndrwxr-xr-x 2 test hero 4096 Dec 21 19:54 tmp<br \/>\n$ ls -lh<br \/>\ntotal 4.0K<br \/>\n-rw-r&#8211;r&#8211; 1 test hero    0 Dec 21 19:54 test<br \/>\ndrwxr-xr-x 2 test hero 4.0K Dec 21 19:54 tmp<br \/>\n$ ls -ll<br \/>\ntotal 4<br \/>\n-rw-r&#8211;r&#8211; 1 test hero    0 Dec 21 19:54 test<br \/>\ndrwxr-xr-x 2 test hero 4096 Dec 21 19:54 tmp<br \/>\n$ ls -alh<br \/>\ntotal 28K<br \/>\ndrwx&#8212;&#8212;   3 test hero 4.0K Dec 21 19:54 .<br \/>\ndrwxr-xr-x. 19 root  root 4.0K Aug  1 10:41 ..<br \/>\n-rw&#8212;&#8212;-   1 test hero  226 Dec 21 19:54 .bash_history<br \/>\n-rw-r&#8211;r&#8211;   1 test hero   18 Aug  3  2016 .bash_logout<br \/>\n-rw-r&#8211;r&#8211;   1 test hero  193 Aug  3  2016 .bash_profile<br \/>\n-rw-r&#8211;r&#8211;   1 test hero  231 Aug  3  2016 .bashrc<br \/>\n-rw-r&#8211;r&#8211;   1 test hero    0 Dec 21 19:54 test<br \/>\ndrwxr-xr-x   2 test hero 4.0K Dec 21 19:54 tmp<br \/>\n$ ls -o<br \/>\ntotal 4<br \/>\n-rw-r&#8211;r&#8211; 1 test    0 Dec 21 19:54 test<br \/>\ndrwxr-xr-x 2 test 4096 Dec 21 19:54 tmp<br \/>\n$ ls -oh<br \/>\ntotal 4.0K<br \/>\n-rw-r&#8211;r&#8211; 1 test    0 Dec 21 19:54 test<br \/>\ndrwxr-xr-x 2 test 4.0K Dec 21 19:54 tmp<br \/>\npwd \u2014\u2014 Print Working Directory<br \/>\npwd\u4ecb\u7ecd<br \/>\n\u2003\u6253\u5370\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u7684\u5b8c\u6574\u8def\u5f84\u540d\u3002(print name of current\/working directory)<\/p>\n<p>\u53c2\u6570\u683c\u5f0f<br \/>\npwd [OPTION]&#8230;<\/p>\n<p>pwd \u7528\u6cd5\u5c55\u793a<br \/>\n[test@Mfate171193 \/home\/test] 20:06<br \/>\n$ pwd<br \/>\n\/home\/test<br \/>\ntouch  (change file timestamps)<br \/>\ntouch\u4ecb\u7ecd<br \/>\nUpdate the access and modification times of each FILE to the current time.<\/p>\n<p>A FILE argument that does not exist is created empty, unless -c or -h is supplied.<\/p>\n<p>\u2003\u5c06\u6bcf\u4e2a\u6587\u4ef6\u7684\u8bbf\u95ee\u548c\u4fee\u6539\u65f6\u95f4\u66f4\u65b0\u4e3a\u5f53\u524d\u65f6\u95f4\u3002\u9664\u975e\u63d0\u4f9b-c\u6216-h\uff0c\u5426\u5219\u5c06\u4e0d\u5b58\u5728\u7684FILE\u53c2\u6570\u521b\u5efa\u4e3a\u7a7a\u3002<\/p>\n<p>touch\u53c2\u6570\u683c\u5f0f<br \/>\ntouch [OPTION]&#8230; FILE&#8230;<\/p>\n<p>touch\u547d\u4ee4\u53c2\u6570<br \/>\n-a  \u6216&#8211;time=atime\u6216&#8211;time=access\u6216&#8211;time=use \u53ea\u66f4\u6539\u5b58\u53d6\u65f6\u95f4\u3002<\/p>\n<p>-c  \u6216&#8211;no-create \u4e0d\u5efa\u7acb\u4efb\u4f55\u6587\u6863\u3002<\/p>\n<p>-d \u4f7f\u7528\u6307\u5b9a\u7684\u65e5\u671f\u65f6\u95f4\uff0c\u800c\u975e\u73b0\u5728\u7684\u65f6\u95f4\u3002<\/p>\n<p>-f \u6b64\u53c2\u6570\u5c06\u5ffd\u7565\u4e0d\u4e88\u5904\u7406\uff0c\u4ec5\u8d1f\u8d23\u89e3\u51b3BSD\u7248\u672ctouch\u6307\u4ee4\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<p>-m  \u6216&#8211;time=mtime\u6216&#8211;time=modify \u53ea\u66f4\u6539\u53d8\u52a8\u65f6\u95f4\u3002<\/p>\n<p>-r \u628a\u6307\u5b9a\u6587\u6863\u6216\u76ee\u5f55\u7684\u65e5\u671f\u65f6\u95f4\uff0c\u7edf\u7edf\u8bbe\u6210\u548c\u53c2\u8003\u6587\u6863\u6216\u76ee\u5f55\u7684\u65e5\u671f\u65f6\u95f4\u76f8\u540c\u3002<\/p>\n<p>-t \u4f7f\u7528\u6307\u5b9a\u7684\u65e5\u671f\u65f6\u95f4\uff0c\u800c\u975e\u73b0\u5728\u7684\u65f6\u95f4\u3002<\/p>\n<p>\u7528\u6cd5\u793a\u4f8b<\/p>\n<h1>\u521b\u5efa\u4e09\u4e2a\u6587\u4ef6<\/h1>\n<p>$ touch test1 test2 test3<\/p>\n<h1>\u4e0d\u521b\u5efa\u6587\u6863<\/h1>\n<p>$ touch -c test5<br \/>\n$ ls<br \/>\ntest1  test2  test3<\/p>\n<h1>\u53ef\u4ee5\u770b\u5230\u53ea\u521b\u5efa\u4e86test1\u3001test2\u3001test3 \uff0c -c\u4e0d\u5efa\u7acb\u4efb\u4f55\u6587\u4ef6<\/h1>\n<p>$ touch -t 201911110000 test1<br \/>\n$ stat test*<\/p>\n<h1>stat\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u7684\u8be6\u7ec6\u53d8\u66f4\u65f6\u95f4\uff0c\u53ef\u4ee5test1\u6587\u4ef6\u7684\u6700\u540e\u4fee\u6539\u65f6\u95f4\u4e3a201911110000\uff0c\u8bf4\u660etouch -t\u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u6700\u540e\u8bbf\u95ee\u65f6\u95f4\u3002\u8fd9\u4e2a\u53c2\u6570\u8fd8\u662f\u5f88\u6709\u7528\u7684\uff0c\u4f60\u53ef\u4ee5\u628a\u4f60\u6700\u8fd1\u8bbf\u95ee\u7684\u65f6\u95f4\u4fee\u6539\u4e3a\u4e00\u4e2a\u5f88\u65e9\u7684\u65f6\u95f4\u3002\u53ef\u4ee5\u505a\u4e00\u4e9b\u6709\u8da3\u7684\u4e8b\u60c5\uff0c\u54c8\u54c8\u3002<\/h1>\n<p>File: \u2018test1\u2019<br \/>\nSize: 0             Blocks: 0          IO Block: 4096   regular empty file<br \/>\nDevice: fd01h\/64769d    Inode: 360736      Links: 1<br \/>\nAccess: (0644\/-rw-r&#8211;r&#8211;)  Uid: (14060\/   localhost)   Gid: ( 1001\/    hero)<br \/>\nAccess: 2019-11-11 00:00:00.000000000 +0800<br \/>\nModify: 2019-11-11 00:00:00.000000000 +0800<br \/>\nChange: 2019-12-21 20:58:11.290761038 +0800<br \/>\nBirth: &#8211;<br \/>\nFile: \u2018test2\u2019<br \/>\nSize: 0             Blocks: 0          IO Block: 4096   regular empty file<br \/>\nDevice: fd01h\/64769d    Inode: 360738      Links: 1<br \/>\nAccess: (0644\/-rw-r&#8211;r&#8211;)  Uid: (14060\/   localhost)   Gid: ( 1001\/    hero)<br \/>\nAccess: 2019-12-21 20:56:34.523761038 +0800<br \/>\nModify: 2019-12-21 20:56:34.523761038 +0800<br \/>\nChange: 2019-12-21 20:56:34.523761038 +0800<br \/>\nBirth: &#8211;<br \/>\nFile: \u2018test3\u2019<br \/>\nSize: 0             Blocks: 0          IO Block: 4096   regular empty file<br \/>\nDevice: fd01h\/64769d    Inode: 360740      Links: 1<br \/>\nAccess: (0644\/-rw-r&#8211;r&#8211;)  Uid: (14060\/   localhost)   Gid: ( 1001\/    hero)<br \/>\nAccess: 2019-12-21 20:56:34.523761038 +0800<br \/>\nModify: 2019-12-21 20:56:34.523761038 +0800<br \/>\nChange: 2019-12-21 20:56:34.523761038 +0800<br \/>\nBirth: &#8211;<br \/>\ncat&amp;tac (Concatenate FILE(s), or standard input, to standard output.)<br \/>\ncat\u4ecb\u7ecd<br \/>\nConcatenate FILE(s), or standard input, to standard output.<\/p>\n<p>\u5c06FILE\u6216\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230\u6807\u51c6\u8f93\u51fa\u3002<\/p>\n<p>cat \u53c2\u6570\u683c\u5f0f<br \/>\ncat [OPTION]&#8230; [FILE]&#8230;<\/p>\n<p>cat\u547d\u4ee4\u53c2\u6570<br \/>\n-A, &#8211;show-all      \u7b49\u4ef7\u4e8e -vET<\/p>\n<p>-b, &#8211;number-nonblank  \u5bf9\u975e\u7a7a\u8f93\u51fa\u884c\u7f16\u53f7<\/p>\n<p>-e            \u7b49\u4ef7\u4e8e -vE<\/p>\n<p>-E, &#8211;show-ends     \u5728\u6bcf\u884c\u7ed3\u675f\u5904\u663e\u793a<\/p>\n<p>-n, &#8211;number   \u5bf9\u8f93\u51fa\u7684\u6240\u6709\u884c\u7f16\u53f7,\u75311\u5f00\u59cb\u5bf9\u6240\u6709\u8f93\u51fa\u7684\u884c\u6570\u7f16\u53f7<\/p>\n<p>-s, &#8211;squeeze-blank \u6709\u8fde\u7eed\u4e24\u884c\u4ee5\u4e0a\u7684\u7a7a\u767d\u884c\uff0c\u5c31\u4ee3\u6362\u4e3a\u4e00\u884c\u7684\u7a7a\u767d\u884c<\/p>\n<p>-t            \u4e0e -vT \u7b49\u4ef7<\/p>\n<p>-T, &#8211;show-tabs     \u5c06\u8df3\u683c\u5b57\u7b26\u663e\u793a\u4e3a ^I<\/p>\n<p>-u            (\u88ab\u5ffd\u7565)<\/p>\n<p>-v, &#8211;show-nonprinting  \u4f7f\u7528 ^ \u548c M- \u5f15\u7528\uff0c\u9664\u4e86 LFD \u548c TAB \u4e4b\u5916<\/p>\n<p>cat\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ cat test  #\u5c55\u793a\u6587\u4ef6\u5185\u5bb9<br \/>\n-A, &#8211;show-all      \u7b49\u4ef7\u4e8e -vET<br \/>\n-b, &#8211;number-nonblank  \u5bf9\u975e\u7a7a\u8f93\u51fa\u884c\u7f16\u53f7<br \/>\n-e            \u7b49\u4ef7\u4e8e -vE<\/p>\n<p>$ cat -n test  #\u5c55\u793a\u6587\u4ef6\u5185\u5bb9\u5e76\u4e14\u5c55\u793a\u884c\u53f7<br \/>\n1    -A, &#8211;show-all      \u7b49\u4ef7\u4e8e -vET<br \/>\n2    -b, &#8211;number-nonblank  \u5bf9\u975e\u7a7a\u8f93\u51fa\u884c\u7f16\u53f7<br \/>\n3    -e            \u7b49\u4ef7\u4e8e -vE<br \/>\ntac\u547d\u4ee4\u4e0ecat\u547d\u4ee4\u5c55\u793a\u5185\u5bb9\u76f8\u53cd\uff0c\u4e0d\u80fd\u5e26\u884c\u53f7\u8f93\u51fa\u3002<br \/>\n$ tac test<br \/>\n-e            \u7b49\u4ef7\u4e8e -vE<br \/>\n-b, &#8211;number-nonblank  \u5bf9\u975e\u7a7a\u8f93\u51fa\u884c\u7f16\u53f7<br \/>\n-A, &#8211;show-all      \u7b49\u4ef7\u4e8e -vET<br \/>\nmkdir \u2014\u2014 Make Directory<br \/>\nmkdir\u4ecb\u7ecd<br \/>\nCreate the DIRECTORY(ies), if they do not already exist.<\/p>\n<p>\u5982\u679c\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u5219\u521b\u5efa\u76ee\u5f55\u3002<\/p>\n<p>mkdir\u53c2\u6570\u683c\u5f0f<br \/>\nmkdir [OPTION]&#8230; DIRECTORY&#8230;<\/p>\n<p>mkdir\u547d\u4ee4\u53c2\u6570<br \/>\n-m, &#8211;mode=\u6a21\u5f0f\uff0c\u8bbe\u5b9a\u6743\u9650&lt;\u6a21\u5f0f&gt; (\u7c7b\u4f3c chmod)\uff0c\u800c\u4e0d\u662f rwxrwxrwx \u51cf umask<\/p>\n<p>-p, &#8211;parents \u53ef\u4ee5\u662f\u4e00\u4e2a\u8def\u5f84\u540d\u79f0\u3002\u6b64\u65f6\u82e5\u8def\u5f84\u4e2d\u7684\u67d0\u4e9b\u76ee\u5f55\u5c1a\u4e0d\u5b58\u5728,\u52a0\u4e0a\u6b64\u9009\u9879\u540e,\u7cfb\u7edf\u5c06\u81ea\u52a8\u5efa\u7acb\u597d\u90a3\u4e9b\u5c1a\u4e0d\u5b58\u5728\u7684\u76ee\u5f55,\u5373\u4e00\u6b21\u53ef\u4ee5\u5efa\u7acb\u591a\u4e2a\u76ee\u5f55;<\/p>\n<p>-v, &#8211;verbose \u6bcf\u6b21\u521b\u5efa\u65b0\u76ee\u5f55\u90fd\u663e\u793a\u4fe1\u606f<\/p>\n<p>&#8211;help  \u663e\u793a\u6b64\u5e2e\u52a9\u4fe1\u606f\u5e76\u9000\u51fa<\/p>\n<p>&#8211;version \u8f93\u51fa\u7248\u672c\u4fe1\u606f\u5e76\u9000\u51fa<\/p>\n<p>mkdir\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u521b\u5efa\u76ee\u5f55\u6587\u4ef6test<\/h1>\n<p>$ mkdir test<\/p>\n<h1>\u8fde\u7eed\u521b\u5efa<\/h1>\n<p>$ mkdir -p test1\/tmp<br \/>\n$ ls<br \/>\ntest  test1<\/p>\n<h1>\u521b\u5efa\u65f6\u7f6e\u9876\u76ee\u5f55\u6743\u9650<\/h1>\n<h1>tmp\u76ee\u5f55\u62e5\u6709\u53ef\u6267\u884c\u6743\u9650\uff0cLinux\u6587\u4ef6\u6743\u9650\u95ee\u9898\u540e\u671f\u6587\u7ae0\u4f1a\u8be6\u7ec6\u8bb2\u5230\uff0c\u8bb0\u5f97\u5173\u6ce8\u6211<\/h1>\n<p>$ mkdir -pm 777 test2\/tmp<br \/>\n$ ls -lh<br \/>\ntotal 12K<br \/>\ndrwxr-xr-x 2 localhost hero 4.0K Dec 21 21:39 test<br \/>\ndrwxr-xr-x 3 localhost hero 4.0K Dec 21 21:40 test1<br \/>\ndrwxr-xr-x 3 localhost hero 4.0K Dec 21 21:40 test2<br \/>\n$ ls<br \/>\ntest  test1  test2<\/p>\n<h1>-v \u53c2\u6570\u53ef\u786e\u5b9a\u6587\u4ef6\u662f\u5426\u5df2\u7ecf\u5b58\u5728\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5219\u4f1a\u521b\u5efa\uff0c\u5e76\u663e\u793a\u5982\u4e0b\u4fe1\u606f<\/h1>\n<p>$ mkdir -v test<br \/>\nmkdir: cannot create directory \u2018test\u2019: File exists<\/p>\n<p>$ mkdir -v test7<br \/>\nmkdir: created directory \u2018test7\u2019<br \/>\ncd \u2014\u2014 Change Directory<br \/>\ncd\u4ecb\u7ecd<br \/>\n\u2003\u5207\u6362\u5f53\u524d\u76ee\u5f55\u81f3\u6307\u5b9a\u76ee\u5f55<\/p>\n<p>\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u6253\u5370\u5f53\u524d\u76ee\u5f55\u5230\u6807\u51c6\u8f93\u51fa<\/h1>\n<p>$ pwd<br \/>\n\/Users\/localhost<\/p>\n<h1>\u5207\u6362\u5230\u76ee\u5f55\/<\/h1>\n<p>$cd \/<br \/>\n\u2003cd\u547d\u4ee4\u6ca1\u4ec0\u4e48\u53c2\u6570\u5c31\u662f\u5207\u6362\u76ee\u5f55\u5230\u6307\u5b9a\u8def\u5f84\u4e0b\uff0c\u8f83\u4e3a\u7b80\u5355\uff0c\u4f46\u662f\u4f7f\u7528\u8bc4\u7387\u6781\u9ad8\u3002<\/p>\n<p>rm&amp;rmdir  \u2014\u2014 Remove Directory<br \/>\nrm\u4ecb\u7ecd<br \/>\nThe rm utility attempts to remove the non-directory type files specified on the command line.  If the permissions of the file do not permit writing, and the standard input device is a terminal, the user is prompted (on the standard error output) for confirmation.<\/p>\n<p>rm\u5b9e\u7528\u7a0b\u5e8f\u5c1d\u8bd5\u5220\u9664\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u7684\u975e\u76ee\u5f55\u7c7b\u578b\u6587\u4ef6\u3002 \u5982\u679c\u6587\u4ef6\u7684\u6743\u9650\u4e0d\u5141\u8bb8\u5199\u5165\uff0c\u5e76\u4e14\u6807\u51c6\u8f93\u5165\u8bbe\u5907\u662f\u7ec8\u7aef\uff0c\u5219\u4f1a\u63d0\u793a\u7528\u6237\uff08\u5728\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u4e0a\uff09\u8fdb\u884c\u786e\u8ba4\u3002<\/p>\n<p>\u2003rm\u547d\u4ee4\u4f7f\u7528\u65f6\u8fd8\u662f\u9700\u8981\u6ce8\u610f\u7684\uff0c\u4ed6\u7684\u5220\u9664\u6062\u590d\u6bd4\u8f83\u9ebb\u70e6\uff0c\u6709\u4e9b\u7cfb\u7edf\u4f1a\u81ea\u5e26-i\u53c2\u6570\uff0c\u8f93\u5165\u547d\u4ee4\u4e4b\u540e\u8fd8\u6709\u4e00\u4e2a\u786e\u8ba4\u6b65\u9aa4\uff0c\u6709\u4e9b\u662f\u76f4\u63a5\u5220\u6389\u4e86\uff0c\u662f\u771f\u5220\u6389\uff0c\u4ece\u5185\u5b58\u62b9\u6389\u90a3\u79cd\uff08\u5176\u5b9e\u5e95\u5c42\u662f\u8ba9\u8be5\u6587\u4ef6\u6307\u9488\u4e0d\u6307\u5411\u8be5\u6587\u4ef6\u7684\u5185\u5b58\u5757\uff0c\u5185\u5b58\u4e0a\u7684\u5185\u5bb9\u539f\u5219\u4e0a\u662f\u5b58\u5728\u7684\uff0c\u4f46\u662f\u6062\u590d\u4f1a\u6bd4\u8f83\u590d\u6742\uff0c\u9700\u8981\u626b\u63cf\u6574\u5757\u5185\u5b58\u5757\u624d\u80fd\u62ff\u5230\u5185\u5bb9\uff09\u3002\u4e0d\u8981\u8f7b\u6613\u5220\u6389\u4f60\u5199\u7684\u91cd\u8981\u4ee3\u7801\uff0chh\u3002<\/p>\n<p>rm\u53c2\u6570\u683c\u5f0f<br \/>\nrm [-dfiPRrvW] file &#8230;<\/p>\n<p>rm\u547d\u4ee4\u53c2\u6570<br \/>\n-f, &#8211;force  \u5ffd\u7565\u4e0d\u5b58\u5728\u7684\u6587\u4ef6\uff0c\u4ece\u4e0d\u7ed9\u51fa\u63d0\u793a\u3002<\/p>\n<p>-i, &#8211;interactive \u8fdb\u884c\u4ea4\u4e92\u5f0f\u5220\u9664<\/p>\n<p>-r, -R, &#8211;recursive  \u6307\u793arm\u5c06\u53c2\u6570\u4e2d\u5217\u51fa\u7684\u5168\u90e8\u76ee\u5f55\u548c\u5b50\u76ee\u5f55\u5747\u9012\u5f52\u5730\u5220\u9664\u3002<\/p>\n<p>-d, &#8211;dir \u5220\u9664\u7a7a\u76ee\u5f55<\/p>\n<p>rm\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u521b\u5efa\u4e09\u4e2a\u6587\u4ef6<\/h1>\n<p>$ touch tmp.cc tmp.java tmp.py tmp.go<\/p>\n<h1>\u521b\u5efa\u76ee\u5f55\u6587\u4ef6<\/h1>\n<p>$ mkdir -p linux\/test<\/p>\n<h1>\u67e5\u770b\u6587\u4ef6\u662f\u5426\u521b\u5efa\u6210\u529f<\/h1>\n<p>$ ls<br \/>\nlinux    tmp.cc   tmp.go   tmp.java tmp.py<\/p>\n<h1>\u5220\u9664\u6587\u4ef6\uff0c\u5e76\u8fdb\u884c\u63d0\u793a<\/h1>\n<p>$ rm -i tmp.cc<br \/>\nremove tmp.cc? y<\/p>\n<h1>\u5f3a\u5236\u5220\u9664<\/h1>\n<p>$ rm  -f tmp.go<\/p>\n<h1>\u5220\u9664\u76ee\u5f55<\/h1>\n<p>$ rm -f linux  #\u5220\u9664\u76ee\u5f55\u5931\u8d25<br \/>\nrm: linux: is a directory<\/p>\n<h1>\u5faa\u73af\u5220\u9664\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6<\/h1>\n<p>$ rm -rf linux  #\u5220\u9664\u76ee\u5f55\u6210\u529f\uff0c<br \/>\n$ ls<br \/>\ntmp.java tmp.py<br \/>\n\u2003rmdir==rm -d  \u5220\u9664\u7a7a\u76ee\u5f55<\/p>\n<p>mv \u2014\u2014 Move<br \/>\nmv\u4ecb\u7ecd<br \/>\nIn its first form, the mv utility renames the file named by the source operand to the destination path named by the target operand.  This form is assumed when the last operand does not name an already existing directory.<\/p>\n<p>In its second form, mv moves each file named by a source operand to a destination file in the existing directory named by the directory operand.  The destination path for each operand is the pathname produced by the concatenation of the last operand, a slash, and the final pathname component of the named file.<\/p>\n<p>\u603b\u7ed3\u4e0b\uff0c\u5c31\u662f\u79fb\u52a8\u76ee\u5f55\u6216\u8005\u6587\u4ef6\u5230\u7f6e\u9876\u76ee\u5f55\u4e0b\uff0c\u540c\u65f6\u5177\u6709\u91cd\u547d\u540d\u7684\u529f\u80fd\u3002<\/p>\n<p>mv\u53c2\u6570\u683c\u5f0f<br \/>\nmv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source &#8230; directory<\/p>\n<p>mv\u547d\u4ee4\u53c2\u6570<br \/>\n-b \uff1a\u82e5\u9700\u8986\u76d6\u6587\u4ef6\uff0c\u5219\u8986\u76d6\u524d\u5148\u884c\u5907\u4efd\u3002<\/p>\n<p>-f \uff1aforce \u5f3a\u5236\u7684\u610f\u601d\uff0c\u5982\u679c\u76ee\u6807\u6587\u4ef6\u5df2\u7ecf\u5b58\u5728\uff0c\u4e0d\u4f1a\u8be2\u95ee\u800c\u76f4\u63a5\u8986\u76d6\uff1b<\/p>\n<p>-i \uff1a\u82e5\u76ee\u6807\u6587\u4ef6 (destination) \u5df2\u7ecf\u5b58\u5728\u65f6\uff0c\u5c31\u4f1a\u8be2\u95ee\u662f\u5426\u8986\u76d6<\/p>\n<p>-n\uff1a\u4e0d\u8981\u8986\u76d6\u73b0\u6709\u6587\u4ef6\u3002 \uff08-n\u9009\u9879\u5c06\u8986\u76d6\u4ee5\u524d\u7684\u4efb\u4f55-f\u6216-i\u9009\u9879\u3002\uff09<\/p>\n<p>-u \uff1a\u82e5\u76ee\u6807\u6587\u4ef6\u5df2\u7ecf\u5b58\u5728\uff0c\u4e14 source \u6bd4\u8f83\u65b0\uff0c\u624d\u4f1a\u66f4\u65b0(update)<\/p>\n<p>mv\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h2>\u4fee\u6539\u6587\u4ef6\u540d<\/h2>\n<p>$ touch tmp.cc<\/p>\n<p>$ ls<br \/>\ntmp.cc<\/p>\n<p>$ mv tmp.cc tmp.java<\/p>\n<p>$ ls<br \/>\ntmp.java<\/p>\n<h1>\u79fb\u52a8\u6587\u4ef6\u6216\u8005\u76ee\u5f55<\/h1>\n<p>$ pwd<br \/>\n\/Users\/localhost\/test<\/p>\n<h1>\u79fb\u52a8\u6587\u4ef6\u5e76\u91cd\u547d\u540d<\/h1>\n<p>$ mv \/Users\/localhost\/logs\/tmp.txt .\/tmp.log <\/p>\n<p>$ ls \/Users\/localhost\/logs\/<br \/>\ndiscover-client metabase        tesla<\/p>\n<p>$ ls .\/<br \/>\ntmp.java tmp.log<\/p>\n<h1>\u79fb\u52a8\u76ee\u5f55\u5e76\u91cd\u547d\u540d<\/h1>\n<p>$ mv \/Users\/localhost\/logs\/tesla  .\/tesla.ba <\/p>\n<p>$ ls<br \/>\ntesla.ba tmp.java tmp.log<br \/>\n\u2003\u8fd9\u4e2a\u547d\u4ee4\u5728\u5199makefile\u6587\u4ef6\u7684\u65f6\u5019\u7528\u8d77\u6765\u5f88\u8212\u670d\uff0c\u53ef\u4ee5\u628a\u7f16\u8bd1\u7684\u7ed3\u679c\u79fb\u5230\u6307\u5b9a\u76ee\u5f55\u5e76\u91cd\u547d\u540d\u3002<\/p>\n<p>cp \u2014\u2014  Copy<br \/>\ncp\u4ecb\u7ecd<br \/>\nIn the first synopsis form, the cp utility copies the contents of the source_file to the target_file.  In the second synopsis form, the contents of each named source_file is copied to the destination target_directory.  The names of the files themselves are not changed.  If cp detects an attempt to copy a file to itself, the copy will fail.<\/p>\n<p>cp\u5b9e\u7528\u7a0b\u5e8f\u5c06source_file\u7684\u5185\u5bb9\u590d\u5236\u5230target_file\u3002 \u5728\u7b2c\u4e8c\u4e2a\u5927\u7eb2\u683c\u5f0f\u4e2d\uff0c\u6bcf\u4e2a\u547d\u540d\u7684source_file\u7684\u5185\u5bb9\u90fd\u590d\u5236\u5230\u76ee\u6807target_directory\u3002 \u6587\u4ef6\u672c\u8eab\u7684\u540d\u79f0\u4e0d\u4f1a\u66f4\u6539\u3002 \u5982\u679ccp\u68c0\u6d4b\u5230\u5c1d\u8bd5\u5c06\u6587\u4ef6\u590d\u5236\u5230\u81ea\u8eab\u7684\u5c1d\u8bd5\uff0c\u5219\u590d\u5236\u5c06\u5931\u8d25\u3002<\/p>\n<p>cp\u53c2\u6570\u683c\u5f0f<br \/>\ncp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file &#8230; target_directory<\/p>\n<p>\u547d\u4ee4\u53c2\u6570<br \/>\n-a, &#8211;archive  \u7b49\u4e8e-dR &#8211;preserve=all<\/p>\n<p>&#8211;backup[=CONTROL  \u4e3a\u6bcf\u4e2a\u5df2\u5b58\u5728\u7684\u76ee\u6807\u6587\u4ef6\u521b\u5efa\u5907\u4efd<\/p>\n<p>-b        \u7c7b\u4f3c&#8211;backup \u4f46\u4e0d\u63a5\u53d7\u53c2\u6570<\/p>\n<p>&#8211;copy-contents    \u5728\u9012\u5f52\u5904\u7406\u662f\u590d\u5236\u7279\u6b8a\u6587\u4ef6\u5185\u5bb9<\/p>\n<p>-d        \u7b49\u4e8e&#8211;no-dereference &#8211;preserve=links<\/p>\n<p>-f, &#8211;force    \u5982\u679c\u76ee\u6807\u6587\u4ef6\u65e0\u6cd5\u6253\u5f00\u5219\u5c06\u5176\u79fb\u9664\u5e76\u91cd\u8bd5(\u5f53 -n \u9009\u9879<\/p>\n<p>\u5b58\u5728\u65f6\u5219\u4e0d\u9700\u518d\u9009\u6b64\u9879)<\/p>\n<p>-i, &#8211;interactive    \u8986\u76d6\u524d\u8be2\u95ee(\u4f7f\u524d\u9762\u7684 -n \u9009\u9879\u5931\u6548)<\/p>\n<p>-H        \u8ddf\u968f\u6e90\u6587\u4ef6\u4e2d\u7684\u547d\u4ee4\u884c\u7b26\u53f7\u94fe\u63a5<\/p>\n<p>-l, &#8211;link      \u94fe\u63a5\u6587\u4ef6\u800c\u4e0d\u590d\u5236<\/p>\n<p>-L, &#8211;dereference  \u603b\u662f\u8ddf\u968f\u7b26\u53f7\u94fe\u63a5<\/p>\n<p>-n, &#8211;no-clobber  \u4e0d\u8981\u8986\u76d6\u5df2\u5b58\u5728\u7684\u6587\u4ef6(\u4f7f\u524d\u9762\u7684 -i \u9009\u9879\u5931\u6548)<\/p>\n<p>-P, &#8211;no-dereference  \u4e0d\u8ddf\u968f\u6e90\u6587\u4ef6\u4e2d\u7684\u7b26\u53f7\u94fe\u63a5<\/p>\n<p>-p        \u7b49\u4e8e&#8211;preserve=\u6a21\u5f0f,\u6240\u6709\u6743,\u65f6\u95f4\u6233<\/p>\n<p>&#8211;preserve[=\u5c5e\u6027\u5217\u8868  \u4fdd\u6301\u6307\u5b9a\u7684\u5c5e\u6027(\u9ed8\u8ba4\uff1a\u6a21\u5f0f,\u6240\u6709\u6743,\u65f6\u95f4\u6233)\uff0c\u5982\u679c<\/p>\n<p>\u53ef\u80fd\u4fdd\u6301\u9644\u52a0\u5c5e\u6027\uff1a\u73af\u5883\u3001\u94fe\u63a5\u3001xattr \u7b49<\/p>\n<p>-R, -r, &#8211;recursive \u590d\u5236\u76ee\u5f55\u53ca\u76ee\u5f55\u5185\u7684\u6240\u6709\u9879\u76ee<\/p>\n<p>\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ cat tmp.cc<br \/>\nchange world<\/p>\n<h1>\u62f7\u8d1d\u6587\u4ef6\u5185\u5bb9<\/h1>\n<p>$ cp tmp.cc tmp.java<\/p>\n<p>$ cat tmp.java<br \/>\nchange world<br \/>\necho<br \/>\necho\u4ecb\u7ecd<br \/>\nThe echo utility writes any specified operands, separated by single blank (&#8216;) characters and followed by a newline (\\n&#8217;) character, to the standard output.<\/p>\n<p>echo\u5b9e\u7528\u7a0b\u5e8f\u5c06\u4efb\u4f55\u6307\u5b9a\u7684\u64cd\u4f5c\u6570\u5199\u5165\u6807\u51c6\u8f93\u51fa\uff0c\u8fd9\u4e9b\u64cd\u4f5c\u6570\u7531\u5355\u4e2a\u7a7a\u683c\uff08\uff09\u5b57\u7b26\u5206\u9694\uff0c\u540e\u8ddf\u6362\u884c\u7b26\uff08\\ n&#8217;\uff09\u5b57\u7b26\u3002<\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u8f83\u4e3a\u7b80\u5355\uff0c\u5e38\u7528\u6765\u6253\u5370\u53d8\u91cf\u3001\u6587\u672c\u5185\u5bb9\u5230\uff0c\u4f8b\u5982:<\/p>\n<p>$ echo &quot;change world&quot;<br \/>\nchange world<\/p>\n<h1>s\u8f93\u51faPWD\u73af\u5883\u53d8\u91cf\u7684\u503c<\/h1>\n<p>$ echo $PWD<br \/>\n\/Users\/localhost\/test<br \/>\n$PWD \u662f\u53d6\u5f53\u524d\u8def\u5f84\uff0c\u7136\u540eecho\u5230\u6807\u51c6\u8f93\u51fa\uff0c\u4e00\u822cecho \\$name \u7528\u6765\u67e5\u770b\u67d0\u4e2a\u73af\u5883\u53d8\u91cf\u7684\u503c<\/p>\n<p>head&amp;tail<br \/>\nhead\u4ecb\u7ecd<br \/>\nThis filter displays the first count lines or bytes of each of the specified files, or of the standard input if no files are specified.  If count is omitted it defaults to 10.<\/p>\n<p>\u6b64\u8fc7\u6ee4\u5668\u663e\u793a\u6bcf\u4e2a\u6307\u5b9a\u6587\u4ef6\u6216\u6807\u51c6\u8f93\u5165\uff08\u5982\u679c\u672a\u6307\u5b9a\u6587\u4ef6\uff09\u7684\u524d\u51e0\u884c\u6216\u5b57\u8282\u3002<\/p>\n<p>If more than a single file is specified, each file is preceded by a header consisting of the string ==&gt; XXX &lt;==&#8221; whereXXX&#8221; is the name of the file.<\/p>\n<p>\u5982\u679c\u7701\u7565count\uff0c\u5219\u9ed8\u8ba4\u4e3a10.\u5982\u679c\u6307\u5b9a\u4e86\u591a\u4e2a\u6587\u4ef6\uff0c\u5219\u6bcf\u4e2a\u6587\u4ef6\u7684\u5934\u5747\u7531\u5b57\u7b26\u4e32==&gt; XXX &lt;==&#8221;\u7ec4\u6210\uff0c\u5176\u4e2dXXX&#8221;\u4e3a\u6587\u4ef6\u540d \u6587\u4ef6\u3002<\/p>\n<p>head\u53c2\u6570\u683c\u5f0f<br \/>\nhead [-n count | -c bytes] [file &#8230;]<\/p>\n<p>head\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n-n \u5c55\u793a\u524dn\u884c<\/p>\n<p>-c \u5c55\u793a\u524dn\u4e2a\u5b57\u7b26<\/p>\n<p>head\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ cat -n test.txt #\u8fd9\u5c31\u7528\u4e0a\u524d\u9762\u7684cat\u547d\u4ee4\u7684-n\u53c2\u6570\uff0c\u8981\u5b66\u4f1a\u5b66\u4ee5\u81f4\u7528\u54e6\u3002<br \/>\n1    \u7528<br \/>\n2    \u5fc3<br \/>\n3    \u5206<br \/>\n4    \u4eab\uff0c<br \/>\n5    \u5171<br \/>\n6    \u540c<br \/>\n7    \u6210<br \/>\n8    \u957f.<br \/>\n9<br \/>\n10    \u6ca1<br \/>\n11    \u6709<br \/>\n12    \u4ec0<br \/>\n13    \u4e48<br \/>\n14    \u6bd4<br \/>\n15    \u4f60<br \/>\n16    \u6bcf<br \/>\n17    \u5929<br \/>\n18    \u8fdb<br \/>\n19    \u6b65<br \/>\n20    \u4e00<br \/>\n21    \u70b9<br \/>\n22    \u66f4<br \/>\n23    \u5b9e<br \/>\n24    \u5728<br \/>\n25    \u4e86<br \/>\n26    .<\/p>\n<p>$ head test.txt  #\u9ed8\u8ba4\u5c55\u793a10\u884c<br \/>\n\u7528<br \/>\n\u5fc3<br \/>\n\u5206<br \/>\n\u4eab\uff0c<br \/>\n\u5171<br \/>\n\u540c<br \/>\n\u6210<br \/>\n\u957f.<\/p>\n<p>\u6ca1<\/p>\n<p>$ head -n15 test.txt #\u5c55\u793a15\u884c<br \/>\n\u7528<br \/>\n\u5fc3<br \/>\n\u5206<br \/>\n\u4eab\uff0c<br \/>\n\u5171<br \/>\n\u540c<br \/>\n\u6210<br \/>\n\u957f.<\/p>\n<p>\u6ca1<br \/>\n\u6709<br \/>\n\u4ec0<br \/>\n\u4e48<br \/>\n\u6bd4<br \/>\n\u4f60<\/p>\n<p>$ head -c23 test.txt #\u5c55\u793a\u524d23\u4e2a\u5b57\u7b26\uff0c\u4e2d\u6587\u4e00\u4e2a\u6c49\u5b57\u5e76\u975e\u4e00\u4e2a\u5b57\u7b26\u7684(utf-8\u7f16\u7801\u4e2d\u6587\u5b57\u7b26\u957f\u5ea6\u662f\u53ef\u53d8\u7684)<br \/>\n\u7528<br \/>\n\u5fc3<br \/>\n\u5206<br \/>\n\u4eab\uff0c<br \/>\n\u5171<br \/>\ntail\u547d\u4ee4\u5b8c\u5168\u548c\u4ed6\u76f8\u53cd\uff0c\u662f\u4ece\u5c3e\u90e8\u5f00\u59cb\u5c55\u793a\u6587\u672c\uff0c\u4f46\u662f\u4ed6\u7684\u53c2\u6570\u7528\u6cd5\u66f4\u591a\u3002<\/p>\n<p>-f \u5faa\u73af\u8bfb\u53d6<\/p>\n<p>-q \u4e0d\u663e\u793a\u5904\u7406\u4fe1\u606f<\/p>\n<p>-v \u663e\u793a\u8be6\u7ec6\u7684\u5904\u7406\u4fe1\u606f<\/p>\n<p>-c&lt;\u6570\u76ee&gt; \u663e\u793a\u7684\u5b57\u8282\u6570<\/p>\n<p>-n&lt;\u884c\u6570&gt; \u663e\u793a\u884c\u6570<\/p>\n<p>&#8211;pid=PID \u4e0e-f\u5408\u7528,\u8868\u793a\u5728\u8fdb\u7a0bID,PID\u6b7b\u6389\u4e4b\u540e\u7ed3\u675f.<\/p>\n<p>-q, &#8211;quiet, &#8211;silent \u4ece\u4e0d\u8f93\u51fa\u7ed9\u51fa\u6587\u4ef6\u540d\u7684\u9996\u90e8<\/p>\n<p>-s, &#8211;sleep-interval=S \u4e0e-f\u5408\u7528,\u8868\u793a\u5728\u6bcf\u6b21\u53cd\u590d\u7684\u95f4\u9694\u4f11\u7720S\u79d2<\/p>\n<p>tail\u548chead\u547d\u4ee4\u7ecf\u5e38\u7528\u6765\u67e5\u770b\u65e5\u5fd7\uff0c\u50cf\u6211\u73b0\u5728\u57fa\u672c\u6bcf\u5929\u90fd\u4f1a\u7528\uff0c\u6211\u7684\u65e5\u5fd7\u6587\u4ef6\u6ca1\u529e\u6cd5\u7528vim\u6216\u8005cat\u8fd9\u6837\u53bb\u770b\uff08\u56e0\u4e3a\u6211\u8d1f\u8d23\u7684\u4e1a\u52a1\u65e5\u5fd7\u91cf\u6bcf\u5929\u90fd\u662f\u51e0\u5341\u4e2aG\uff09\uff0c\u8981\u4e48\u7528tail\uff0c\u8981\u4e48\u7528more&amp;less(\u4e0b\u9762\u4f1a\u8bb2)\u3002<\/p>\n<p>more&amp;less<br \/>\nmore\u4ecb\u7ecd<br \/>\nLess  is  a  program similar to more (1), but which allows backward movement in the file as well as forward movement.  Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi (1).  Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals.  There is even limited support for hardcopy terminals.  (On a hardcopy terminal, lines which should be printed  at the top of the screen are prefixed with a caret.)<\/p>\n<p>more\u6bcf\u6b21\u6253\u5f00\u6587\u4ef6\u4e0d\u662f\u5168\u90e8\u628a\u6587\u4ef6\u8bfb\u5165\u5185\u5b58\u800c\u662f\u6d41\u5f0f\u8bfb\u53d6\uff0c\u4e0d\u4f1a\u56e0\u4e3avi|vim\u67d0\u4e2a\u5927\u6587\u4ef6\u800c\u9020\u6210\u7cfb\u7edfoom\u3002<\/p>\n<p>more&amp;less\u6700\u91cd\u8981\u7684\u4e00\u70b9\u5c31\u662f\u6d41\u5f0f\u8bfb\u53d6\uff0c\u652f\u6301\u7ffb\u9875\uff0c\u50cfcat\u547d\u4ee4\u662f\u5168\u90e8\u8bfb\u53d6\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\uff0c\u5982\u679c\u6587\u4ef6\u592a\u5927\u4f1a\u628a\u5c4f\u5e55\u5237\u6ee1\u7684\uff0c\u6839\u672c\u6ca1\u529e\u6cd5\u770b\u3002<\/p>\n<p>more\u53c2\u6570\u683c\u5f0f<br \/>\nmore [-dlfpcsu ] [-num ] [+\/ pattern] [+ linenum] [file &#8230; ]<\/p>\n<p>more\u547d\u4ee4\u53c2\u6570<br \/>\n+n   \u4ece\u7b2bn\u884c\u5f00\u59cb\u663e\u793a<\/p>\n<p>-n    \u5b9a\u4e49\u5c4f\u5e55\u5927\u5c0f\u4e3an\u884c<\/p>\n<p>+\/pattern \u5728\u6bcf\u4e2a\u6863\u6848\u663e\u793a\u524d\u641c\u5bfb\u8be5\u5b57\u4e32\uff08pattern\uff09\uff0c\u7136\u540e\u4ece\u8be5\u5b57\u4e32\u524d\u4e24\u884c\u4e4b\u540e\u5f00\u59cb\u663e\u793a<\/p>\n<p>-c    \u4ece\u9876\u90e8\u6e05\u5c4f\uff0c\u7136\u540e\u663e\u793a<\/p>\n<p>-d    \u63d0\u793a\u201cPress space to continue\uff0c\u2019q\u2019 to quit\uff08\u6309\u7a7a\u683c\u952e\u7ee7\u7eed\uff0c\u6309q\u952e\u9000\u51fa\uff09\u201d\uff0c\u7981\u7528\u54cd\u94c3\u529f\u80fd<\/p>\n<p>-l    \u5ffd\u7565Ctrl+l\uff08\u6362\u9875\uff09\u5b57\u7b26<\/p>\n<p>-p    \u901a\u8fc7\u6e05\u9664\u7a97\u53e3\u800c\u4e0d\u662f\u6eda\u5c4f\u6765\u5bf9\u6587\u4ef6\u8fdb\u884c\u6362\u9875\uff0c\u4e0e-c\u9009\u9879\u76f8\u4f3c<\/p>\n<p>-s    \u628a\u8fde\u7eed\u7684\u591a\u4e2a\u7a7a\u884c\u663e\u793a\u4e3a\u4e00\u884c<\/p>\n<p>-u    \u628a\u6587\u4ef6\u5185\u5bb9\u4e2d\u7684\u4e0b\u753b\u7ebf\u53bb\u6389<\/p>\n<p>less \u4e0e more \u7c7b\u4f3c\uff0c\u4f46\u4f7f\u7528 less \u53ef\u4ee5\u968f\u610f\u6d4f\u89c8\u6587\u4ef6\uff0c\u800c more \u4ec5\u80fd\u5411\u524d\u79fb\u52a8\uff0c\u5374\u4e0d\u80fd\u5411\u540e\u79fb\u52a8\uff0c\u800c\u4e14 less \u5728\u67e5\u770b\u4e4b\u524d\u4e0d\u4f1a\u52a0\u8f7d\u6574\u4e2a\u6587\u4ef6<\/p>\n<p>wc<br \/>\nwc\u4ecb\u7ecd<br \/>\nThe wc utility displays the number of lines, words, and bytes contained in each input file, or standard input (if no file is specified) to the standard output.  A line is defined as a string of characters delimited by acharac-ter.  Characters beyond the finalcharacter will not be included in the line count.<\/p>\n<p>wc\u5b9e\u7528\u7a0b\u5e8f\u663e\u793a\u6bcf\u4e2a\u8f93\u5165\u6587\u4ef6\u6216\u6807\u51c6\u8f93\u5165\uff08\u5982\u679c\u672a\u6307\u5b9a\u6587\u4ef6\uff09\u4e2d\u6bcf\u4e2a\u8f93\u5165\u6587\u4ef6\u4e2d\u5305\u542b\u7684\u884c\u6570\uff0c\u5b57\u6570\u548c\u5b57\u8282\u6570\u3002 \u4e00\u884c\u5b9a\u4e49\u4e3a\u7531\u5b57\u7b26\u5206\u9694\u7684\u5b57\u7b26\u4e32\u3002 \u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u4e4b\u540e\u7684\u5b57\u7b26\u5c06\u4e0d\u5305\u62ec\u5728\u884c\u6570\u4e2d\u3002<\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u5bf9\u6211\u6765\u8bf4\u8fd8\u662f\u6bd4\u8f83\u6df1\u523b\u7684\uff0c\u6211\u521a\u5b66\u4e60\u7f16\u7a0b\u4e0d\u4e45\u7684\u65f6\u5019\uff0c\u6211\u611f\u89c9\u6211\u5199\u7684\u4ee3\u7801\u5f88\u591a\u4e86\uff0c\u90a3\u4e2a\u65f6\u5019\u6211\u5c31\u5f88\u60f3\u77e5\u9053\u6211\u5199\u4e86\u591a\u5c11\u884c\u4ee3\u7801\u4e86\uff0c\u4e00\u65f6\u5174\u8d77\uff0c\u8bf4\u5e72\u5c31\u5e72\uff0c\u76f4\u63a5\u5199\u4e86\u4e2a\u7a0b\u5e8f\u53bb\u7edf\u8ba1\u4e86\u4e00\u628a\uff0c\u5199\u5b8c\u4e4b\u540e\u8fd8\u611f\u89c9\u81ea\u5df1\u86ee\u5389\u5bb3\u7684\uff0c\u8c01\u77e5\u9053\u4e4b\u540e\u5b66\u4e60\u5230\u8fd9\u4e2awc\uff0c\u7136\u540e\u5c31\u89c9\u5f97\u81ea\u5df1\u8fd8\u662f\u5ae9\u4e86\u70b9\uff0c\u8fd8\u662f\u8981\u591a\u5b66\u4e60\u3002<\/p>\n<p>wc\u53c2\u6570\u683c\u5f0f<br \/>\nwc [-clmw] [file &#8230;]<\/p>\n<p>wc\u547d\u4ee4\u53c2\u6570<br \/>\n-c \u7edf\u8ba1\u5b57\u8282\u6570\u3002<\/p>\n<p>-l \u7edf\u8ba1\u884c\u6570\u3002<\/p>\n<p>-m \u7edf\u8ba1\u5b57\u7b26\u6570\u3002\u8fd9\u4e2a\u6807\u5fd7\u4e0d\u80fd\u4e0e -c \u6807\u5fd7\u4e00\u8d77\u4f7f\u7528\u3002<\/p>\n<p>-w \u7edf\u8ba1\u5b57\u6570\u3002\u4e00\u4e2a\u5b57\u88ab\u5b9a\u4e49\u4e3a\u7531\u7a7a\u767d\u3001\u8df3\u683c\u6216\u6362\u884c\u5b57\u7b26\u5206\u9694\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p>-L \u6253\u5370\u6700\u957f\u884c\u7684\u957f\u5ea6\u3002<\/p>\n<p>\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ ls<br \/>\ntest.txt<\/p>\n<p>$ wc test.txt<br \/>\n26      26     103 test.txt<\/p>\n<p>$ wc -l test.txt  #\u76f4\u63a5\u4e00\u628a\u7edf\u8ba1\u884c\u6570<br \/>\n26 test.txt<\/p>\n<p>$ wc -c test.txt<br \/>\n103 test.txt<br \/>\ndate &amp; cal<br \/>\ndate\u4ecb\u7ecd<br \/>\nWhen invoked without arguments, the date utility displays the current date and time.  Otherwise, depending on the options specified, date will set the date and time or print it in a user-defined way.<\/p>\n<p>The date utility displays the date and time read from the kernel clock.  When used to set the date and time, both the kernel clock and the hardware clock are updated.<\/p>\n<p>Only the superuser may set the date, and if the system securelevel (see securelevel(7)) is greater than 1, the time may not be changed by more than 1 second.<\/p>\n<p>\u5f53\u4e0d\u5e26\u53c2\u6570\u8c03\u7528\u65f6\uff0cdate\u5b9e\u7528\u7a0b\u5e8f\u5c06\u663e\u793a\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4\u3002 \u5426\u5219\uff0c\u6839\u636e\u6307\u5b9a\u7684\u9009\u9879\uff0c\u65e5\u671f\u5c06\u8bbe\u7f6e\u65e5\u671f\u548c\u65f6\u95f4\u6216\u4ee5\u7528\u6237\u5b9a\u4e49\u7684\u65b9\u5f0f\u6253\u5370\u65e5\u671f\u548c\u65f6\u95f4\u3002<\/p>\n<p>date\u5b9e\u7528\u7a0b\u5e8f\u663e\u793a\u4ece\u5185\u6838\u65f6\u949f\u8bfb\u53d6\u7684\u65e5\u671f\u548c\u65f6\u95f4\u3002 \u5f53\u7528\u4e8e\u8bbe\u7f6e\u65e5\u671f\u548c\u65f6\u95f4\u65f6\uff0c\u5185\u6838\u65f6\u949f\u548c\u786c\u4ef6\u65f6\u949f\u90fd\u5c06\u66f4\u65b0\u3002<\/p>\n<p>\u53ea\u6709\u8d85\u7ea7\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u65e5\u671f\uff0c\u5e76\u4e14\u5982\u679c\u7cfb\u7edf\u5b89\u5168\u7ea7\u522b\uff08\u8bf7\u53c2\u9605securelevel\uff087\uff09\uff09\u5927\u4e8e1\uff0c\u5219\u65f6\u95f4\u66f4\u6539\u4e0d\u5f97\u8d85\u8fc71\u79d2\u3002<\/p>\n<p>date\u53c2\u6570\u683c\u5f0f<br \/>\ndate [-jRu] [-r seconds | filename] [-v [+|-]val[ymwdHMS]] &#8230; [+output_fmt] date [-jnu] [[[mm]dd]HH]MM[[cc]yy][.ss] date [-jnRu] -f input_fmt new_date [+output_fmt] date [-d dst] [-t minutes_west]<\/p>\n<p>date\u547d\u4ee4\u53c2\u6570<br \/>\n%H \u5c0f\u65f6(\u4ee500-23\u6765\u8868\u793a)\u3002<\/p>\n<p>%I \u5c0f\u65f6(\u4ee501-12\u6765\u8868\u793a)\u3002<\/p>\n<p>%K \u5c0f\u65f6(\u4ee50-23\u6765\u8868\u793a)\u3002<\/p>\n<p>%l \u5c0f\u65f6(\u4ee50-12\u6765\u8868\u793a)\u3002<\/p>\n<p>%M \u5206\u949f(\u4ee500-59\u6765\u8868\u793a)\u3002<\/p>\n<p>%P AM\u6216PM\u3002<\/p>\n<p>%r \u65f6\u95f4(\u542b\u65f6\u5206\u79d2\uff0c\u5c0f\u65f6\u4ee512\u5c0f\u65f6AM\/PM\u6765\u8868\u793a)\u3002<\/p>\n<p>%s \u603b\u79d2\u6570\u3002\u8d77\u7b97\u65f6\u95f4\u4e3a1970-01-01 00:00:00 UTC\u3002<\/p>\n<p>%S \u79d2(\u4ee5\u672c\u5730\u7684\u60ef\u7528\u6cd5\u6765\u8868\u793a)\u3002<\/p>\n<p>%T \u65f6\u95f4(\u542b\u65f6\u5206\u79d2\uff0c\u5c0f\u65f6\u4ee524\u5c0f\u65f6\u5236\u6765\u8868\u793a)\u3002<\/p>\n<p>%X \u65f6\u95f4(\u4ee5\u672c\u5730\u7684\u60ef\u7528\u6cd5\u6765\u8868\u793a)\u3002<\/p>\n<p>%Z \u5e02\u533a\u3002<\/p>\n<p>%a \u661f\u671f\u7684\u7f29\u5199\u3002<\/p>\n<p>%A \u661f\u671f\u7684\u5b8c\u6574\u540d\u79f0\u3002<\/p>\n<p>%b \u6708\u4efd\u82f1\u6587\u540d\u7684\u7f29\u5199\u3002<\/p>\n<p>%B \u6708\u4efd\u7684\u5b8c\u6574\u82f1\u6587\u540d\u79f0\u3002<\/p>\n<p>%c \u65e5\u671f\u4e0e\u65f6\u95f4\u3002\u53ea\u8f93\u5165date\u6307\u4ee4\u4e5f\u4f1a\u663e\u793a\u540c\u6837\u7684\u7ed3\u679c\u3002<\/p>\n<p>%d \u65e5\u671f(\u4ee501-31\u6765\u8868\u793a)\u3002<\/p>\n<p>%D \u65e5\u671f(\u542b\u5e74\u6708\u65e5)\u3002<\/p>\n<p>%j \u8be5\u5e74\u4e2d\u7684\u7b2c\u51e0\u5929\u3002<\/p>\n<p>%m \u6708\u4efd(\u4ee501-12\u6765\u8868\u793a)\u3002<\/p>\n<p>%U \u8be5\u5e74\u4e2d\u7684\u5468\u6570\u3002<\/p>\n<p>%w \u8be5\u5468\u7684\u5929\u6570\uff0c0\u4ee3\u8868\u5468\u65e5\uff0c1\u4ee3\u8868\u5468\u4e00\uff0c\u5f02\u8bcd\u7c7b\u63a8\u3002<\/p>\n<p>%x \u65e5\u671f(\u4ee5\u672c\u5730\u7684\u60ef\u7528\u6cd5\u6765\u8868\u793a)\u3002<\/p>\n<p>%y \u5e74\u4efd(\u4ee500-99\u6765\u8868\u793a)\u3002<\/p>\n<p>%Y \u5e74\u4efd(\u4ee5\u56db\u4f4d\u6570\u6765\u8868\u793a)\u3002<\/p>\n<p>%n \u5728\u663e\u793a\u65f6\uff0c\u63d2\u5165\u65b0\u7684\u4e00\u884c\u3002<\/p>\n<p>%t \u5728\u663e\u793a\u65f6\uff0c\u63d2\u5165tab\u3002<\/p>\n<p>MM \u6708\u4efd(\u5fc5\u8981)<\/p>\n<p>DD \u65e5\u671f(\u5fc5\u8981)<\/p>\n<p>hh \u5c0f\u65f6(\u5fc5\u8981)<\/p>\n<p>mm \u5206\u949f(\u5fc5\u8981)<\/p>\n<p>ss \u79d2(\u9009\u62e9\u6027)<\/p>\n<p>-d&lt;\u5b57\u7b26\u4e32&gt; \u663e\u793a\u5b57\u7b26\u4e32\u6240\u6307\u7684\u65e5\u671f\u4e0e\u65f6\u95f4\u3002\u5b57\u7b26\u4e32\u524d\u540e\u5fc5\u987b\u52a0\u4e0a\u53cc\u5f15\u53f7\u3002<\/p>\n<p>-s&lt;\u5b57\u7b26\u4e32&gt; \u6839\u636e\u5b57\u7b26\u4e32\u6765\u8bbe\u7f6e\u65e5\u671f\u4e0e\u65f6\u95f4\u3002\u5b57\u7b26\u4e32\u524d\u540e\u5fc5\u987b\u52a0\u4e0a\u53cc\u5f15\u53f7\u3002<\/p>\n<p>-u \u663e\u793aGMT\u3002<\/p>\n<p>\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ date<br \/>\n2019\u5e7412\u670822\u65e5 \u661f\u671f\u65e5 21\u65f628\u520629\u79d2 CST<\/p>\n<p>$ date &#8216;+%c&#8217;<br \/>\n\u65e5 12\/22 21:28:33 2019<\/p>\n<p>$  date &#8216;+%D&#8217;<br \/>\n12\/22\/19<\/p>\n<p>$  date &#8216;+%T&#8217;<br \/>\n21:28:50<\/p>\n<p>$ date &#8216;+%X&#8217;<br \/>\n21\u65f629\u520600\u79d2<br \/>\ncal\u4ecb\u7ecd<br \/>\ncal\u547d\u4ee4\u53ef\u4ee5\u7528\u6765\u663e\u793a\u516c\u5386\uff08\u9633\u5386\uff09\u65e5\u5386\u3002<\/p>\n<p>cal\u53c2\u6570\u683c\u5f0f<br \/>\ncal [-3hjy] [-A number] [-B number] [[month] year] cal [-3hj] [-A number] [-B number] -m month [year] ncal [-3hjJpwy] [-A number] [-B number] [-s country_code] [[month] year] ncal [-3hJeo] [-A number] [-B number] [year] ncal [-CN] [-H yyyy-mm-dd] [-d yyyy-mm]<\/p>\n<p>cal\u547d\u4ee4\u53c2\u6570<br \/>\n-1 \u663e\u793a\u4e00\u4e2a\u6708\u7684\u6708\u5386<\/p>\n<p>-3 \u663e\u793a\u7cfb\u7edf\u524d\u4e00\u4e2a\u6708\uff0c\u5f53\u524d\u6708\uff0c\u4e0b\u4e00\u4e2a\u6708\u7684\u6708\u5386<\/p>\n<p>-s  \u663e\u793a\u661f\u671f\u5929\u4e3a\u4e00\u4e2a\u661f\u671f\u7684\u7b2c\u4e00\u5929\uff0c\u9ed8\u8ba4\u7684\u683c\u5f0f<\/p>\n<p>-m \u663e\u793a\u661f\u671f\u4e00\u4e3a\u4e00\u4e2a\u661f\u671f\u7684\u7b2c\u4e00\u5929<br \/>\n-j  \u663e\u793a\u5728\u5f53\u5e74\u4e2d\u7684\u7b2c\u51e0\u5929\uff08\u4e00\u5e74\u65e5\u671f\u6309\u5929\u7b97\uff0c\u4ece1\u67081\u53f7\u7b97\u8d77\uff0c\u9ed8\u8ba4\u663e\u793a\u5f53\u524d\u6708\u5728\u4e00\u5e74\u4e2d\u7684\u5929\u6570\uff09<br \/>\n-y  \u663e\u793a\u5f53\u524d\u5e74\u4efd\u7684\u65e5\u5386<\/p>\n<p>cal\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ cal<br \/>\n\u5341\u4e8c\u6708 2019<br \/>\n\u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d<br \/>\n1  2  3  4  5  6  7<br \/>\n8  9 10 11 12 13 14<br \/>\n15 16 17 18 19 20 21<br \/>\n22 23 24 25 26 27 28<br \/>\n29 30 31<\/p>\n<p>$ ncal<br \/>\n\u5341\u4e8c\u6708 2019<br \/>\n\u4e00      2  9 16 23 30<br \/>\n\u4e8c      3 10 17 24 31<br \/>\n\u4e09      4 11 18 25<br \/>\n\u56db      5 12 19 26<br \/>\n\u4e94      6 13 20 27<br \/>\n\u516d      7 14 21 28<br \/>\n\u65e5   1  8 15 22 29<br \/>\nwhich<br \/>\nwhich\u4ecb\u7ecd<br \/>\nThe which utility takes a list of command names and searches the path for each executable file that would be run had these commands actually been invoked.<\/p>\n<p>which\u547d\u4ee4\u7684\u4f5c\u7528\u662f\uff0c\u5728PATH\u53d8\u91cf\u6307\u5b9a\u7684\u8def\u5f84\u4e2d\uff0c\u641c\u7d22\u67d0\u4e2a\u7cfb\u7edf\u547d\u4ee4\u7684\u4f4d\u7f6e\uff0c\u5e76\u4e14\u8fd4\u56de\u7b2c\u4e00\u4e2a\u641c\u7d22\u7ed3\u679c\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f7f\u7528which\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u67d0\u4e2a\u7cfb\u7edf\u547d\u4ee4\u662f\u5426\u5b58\u5728\uff0c\u4ee5\u53ca\u6267\u884c\u7684\u5230\u5e95\u662f\u54ea\u4e00\u4e2a\u4f4d\u7f6e\u7684\u547d\u4ee4\u3002<\/p>\n<p>which\u53c2\u6570\u683c\u5f0f<br \/>\n-n \u6307\u5b9a\u6587\u4ef6\u540d\u957f\u5ea6\uff0c\u6307\u5b9a\u7684\u957f\u5ea6\u5fc5\u987b\u5927\u4e8e\u6216\u7b49\u4e8e\u6240\u6709\u6587\u4ef6\u4e2d\u6700\u957f\u7684\u6587\u4ef6\u540d\u3002<\/p>\n<p>-p \u4e0e-n\u53c2\u6570\u76f8\u540c\uff0c\u4f46\u6b64\u5904\u7684\u5305\u62ec\u4e86\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<p>-w \u6307\u5b9a\u8f93\u51fa\u65f6\u680f\u4f4d\u7684\u5bbd\u5ea6\u3002<\/p>\n<p>which\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ which ls<br \/>\nalias ls=&#8217;ls &#8211;color=auto&#8217;<br \/>\n\/bin\/ls<\/p>\n<p>$ which which<br \/>\nalias which=&#8217;alias | \/usr\/bin\/which &#8211;tty-only &#8211;read-alias &#8211;show-dot &#8211;show-tilde&#8217;<br \/>\n\/bin\/alias<br \/>\n\/usr\/bin\/which<br \/>\nwhereis<br \/>\nwhereis\u4ecb\u7ecd<br \/>\nwhereis\u547d\u4ee4\u53ea\u80fd\u7528\u4e8e\u7a0b\u5e8f\u540d\u7684\u641c\u7d22\uff0c\u800c\u4e14\u53ea\u641c\u7d22\u4e8c\u8fdb\u5236\u6587\u4ef6\uff08\u53c2\u6570-b\uff09\u3001man\u8bf4\u660e\u6587\u4ef6\uff08\u53c2\u6570-m\uff09\u548c\u6e90\u4ee3\u7801\u6587\u4ef6\uff08\u53c2\u6570-s\uff09\u3002\u5982\u679c\u7701\u7565\u53c2\u6570\uff0c\u5219\u8fd4\u56de\u6240\u6709\u4fe1\u606f\u3002<\/p>\n<p>whereis\u53c2\u6570\u683c\u5f0f<br \/>\nwhereis [program &#8230;]<\/p>\n<p>whereis\u547d\u4ee4\u53c2\u6570<br \/>\n-b  \u5b9a\u4f4d\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p>-m  \u5b9a\u4f4d\u5e2e\u52a9\u6587\u4ef6\u3002<\/p>\n<p>-s  \u5b9a\u4f4d\u6e90\u4ee3\u7801\u6587\u4ef6\u3002<\/p>\n<p>-u  \u641c\u7d22\u9ed8\u8ba4\u8def\u5f84\u4e0b\u9664\u53ef\u6267\u884c\u6587\u4ef6\u3001\u6e90\u4ee3\u7801\u6587\u4ef6\u3001\u5e2e\u52a9\u6587\u4ef6\u4ee5\u5916\u7684\u5176\u5b83\u6587\u4ef6\u3002<\/p>\n<p>-B  \u6307\u5b9a\u641c\u7d22\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<p>-M  \u6307\u5b9a\u641c\u7d22\u5e2e\u52a9\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<p>-S  \u6307\u5b9a\u641c\u7d22\u6e90\u4ee3\u7801\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<p>whereis\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ whereis ls<br \/>\n\/bin\/ls<\/p>\n<p>$ whereis whereis<br \/>\n\/usr\/bin\/whereis<br \/>\nnl<br \/>\nnl\u4ecb\u7ecd<br \/>\nnl\u547d\u4ee4\u5728linux\u7cfb\u7edf\u4e2d\u7528\u6765\u8ba1\u7b97\u6587\u4ef6\u4e2d\u884c\u53f7\u3002nl \u53ef\u4ee5\u5c06\u8f93\u51fa\u7684\u6587\u4ef6\u5185\u5bb9\u81ea\u52a8\u7684\u52a0\u4e0a\u884c\u53f7\uff01\u5176\u9ed8\u8ba4\u7684\u7ed3\u679c\u4e0e cat -n \u6709\u70b9\u4e0d\u592a\u4e00\u6837\uff0c nl \u53ef\u4ee5\u5c06\u884c\u53f7\u505a\u6bd4\u8f83\u591a\u7684\u663e\u793a\u8bbe\u8ba1\uff0c\u5305\u62ec\u4f4d\u6570\u4e0e\u662f\u5426\u81ea\u52a8\u8865\u9f50 0 \u7b49\u7b49\u7684\u529f\u80fd\u3002<\/p>\n<p>nl\u53c2\u6570\u683c\u5f0f<br \/>\nnl [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num] [-n format] [-s sep] [-v startnum] [-w width] [file]<\/p>\n<p>nl\u547d\u4ee4\u53c2\u6570<br \/>\n-b \uff1a\u6307\u5b9a\u884c\u53f7\u6307\u5b9a\u7684\u65b9\u5f0f\uff0c\u4e3b\u8981\u6709\u4e24\u79cd\uff1a<\/p>\n<p>-b a \uff1a\u8868\u793a\u4e0d\u8bba\u662f\u5426\u4e3a\u7a7a\u884c\uff0c\u4e5f\u540c\u6837\u5217\u51fa\u884c\u53f7(\u7c7b\u4f3c cat -n)\uff1b<\/p>\n<p>-b t \uff1a\u5982\u679c\u6709\u7a7a\u884c\uff0c\u7a7a\u7684\u90a3\u4e00\u884c\u4e0d\u8981\u5217\u51fa\u884c\u53f7(\u9ed8\u8ba4\u503c)\uff1b<\/p>\n<p>-n \uff1a\u5217\u51fa\u884c\u53f7\u8868\u793a\u7684\u65b9\u6cd5\uff0c\u4e3b\u8981\u6709\u4e09\u79cd\uff1a<\/p>\n<p>-n ln \uff1a\u884c\u53f7\u5728\u8424\u5e55\u7684\u6700\u5de6\u65b9\u663e\u793a\uff1b<\/p>\n<p>-n rn \uff1a\u884c\u53f7\u5728\u81ea\u5df1\u680f\u4f4d\u7684\u6700\u53f3\u65b9\u663e\u793a\uff0c\u4e14\u4e0d\u52a0 0 \uff1b<\/p>\n<p>-n rz \uff1a\u884c\u53f7\u5728\u81ea\u5df1\u680f\u4f4d\u7684\u6700\u53f3\u65b9\u663e\u793a\uff0c\u4e14\u52a0 0 \uff1b<\/p>\n<p>-w \uff1a\u884c\u53f7\u680f\u4f4d\u7684\u5360\u7528\u7684\u4f4d\u6570\u3002<\/p>\n<p>-p \u5728\u903b\u8f91\u5b9a\u754c\u7b26\u5904\u4e0d\u91cd\u65b0\u5f00\u59cb\u8ba1\u7b97\u3002<\/p>\n<p>nl\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ nl test.txt<br \/>\n1    \u7528<br \/>\n2    \u5fc3<br \/>\n3    \u5206<br \/>\n4    \u4eab\uff0c<br \/>\n5    \u5171<br \/>\n6    \u540c<br \/>\n7    \u6210<br \/>\n8    \u957f.<\/p>\n<pre><code> 9    \u6ca1\n10    \u6709\n11    \u4ec0\n12    \u4e48\n13    \u6bd4\n14    \u4f60\n15    \u6bcf\n16    \u5929\n17    \u8fdb\n18    \u6b65\n19    \u4e00\n20    \u70b9\n21    \u66f4\n22    \u5b9e\n23    \u5728\n24    \u4e86\n25    .<\/code><\/pre>\n<p>ps<br \/>\nps\u4ecb\u7ecd<br \/>\nThe ps utility displays a header line, followed by lines containing information about all of your processes that have controlling terminals.<\/p>\n<p>ps\u5b9e\u7528\u7a0b\u5e8f\u663e\u793a\u6807\u9898\u884c\uff0c\u5176\u540e\u662f\u5305\u542b\u6709\u5173\u5177\u6709\u63a7\u5236\u7ec8\u7aef\u7684\u6240\u6709\u8fdb\u7a0b\u7684\u4fe1\u606f\u7684\u884c\u3002<\/p>\n<p>ps\u53c2\u6570\u683c\u5f0f<br \/>\nps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid&#8230;]] [-g grp[,grp&#8230;]] [-u uid[,uid&#8230;]] [-p pid[,pid&#8230;]] [-t tty[,tty&#8230;]] [-U user[,user&#8230;]] ps [-L]<\/p>\n<p>ps\u547d\u4ee4\u53c2\u6570<br \/>\na \u663e\u793a\u6240\u6709\u8fdb\u7a0b<\/p>\n<p>-a \u663e\u793a\u540c\u4e00\u7ec8\u7aef\u4e0b\u7684\u6240\u6709\u7a0b\u5e8f<\/p>\n<p>-A \u663e\u793a\u6240\u6709\u8fdb\u7a0b<\/p>\n<p>c \u663e\u793a\u8fdb\u7a0b\u7684\u771f\u5b9e\u540d\u79f0<\/p>\n<p>-N \u53cd\u5411\u9009\u62e9<\/p>\n<p>-e \u7b49\u4e8e\u201c-A\u201d<\/p>\n<p>e \u663e\u793a\u73af\u5883\u53d8\u91cf<\/p>\n<p>f \u663e\u793a\u7a0b\u5e8f\u95f4\u7684\u5173\u7cfb<\/p>\n<p>-H \u663e\u793a\u6811\u72b6\u7ed3\u6784<\/p>\n<p>r \u663e\u793a\u5f53\u524d\u7ec8\u7aef\u7684\u8fdb\u7a0b<\/p>\n<p>T \u663e\u793a\u5f53\u524d\u7ec8\u7aef\u7684\u6240\u6709\u7a0b\u5e8f<\/p>\n<p>u \u6307\u5b9a\u7528\u6237\u7684\u6240\u6709\u8fdb\u7a0b<\/p>\n<p>-au \u663e\u793a\u8f83\u8be6\u7ec6\u7684\u8d44\u8baf<\/p>\n<p>-aux \u663e\u793a\u6240\u6709\u5305\u542b\u5176\u4ed6\u4f7f\u7528\u8005\u7684\u884c\u7a0b<\/p>\n<p>-C&lt;\u547d\u4ee4&gt; \u5217\u51fa\u6307\u5b9a\u547d\u4ee4\u7684\u72b6\u51b5<\/p>\n<p>&#8211;lines&lt;\u884c\u6570&gt; \u6bcf\u9875\u663e\u793a\u7684\u884c\u6570<\/p>\n<p>&#8211;width&lt;\u5b57\u7b26\u6570&gt; \u6bcf\u9875\u663e\u793a\u7684\u5b57\u7b26\u6570<\/p>\n<p>ps\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u67e5\u770b\u6240\u6709\u8fdb\u7a0b<\/h1>\n<p>$ps -a<\/p>\n<h1>\u67e5\u770b\u8fdb\u7a0b\u7684\u73af\u5883\u53d8\u91cf\u548c\u7a0b\u5e8f\u95f4\u7684\u5173\u7cfb<\/h1>\n<p>$ps -ef<br \/>\nkill&amp;killall<br \/>\nkill\u4ecb\u7ecd<br \/>\nThe  command kill sends the specified signal to the specified process or process group.  If no signal is specified, the TERM signal is sent.  The TERM signal will kill processes which do not catch this signal.  For other processes, it may be necessary to use the KILL (9) signal, since this signal cannot be caught.<\/p>\n<p>\u547d\u4ee4kill\u5c06\u6307\u5b9a\u7684\u4fe1\u53f7\u53d1\u9001\u5230\u6307\u5b9a\u7684\u8fdb\u7a0b\u6216\u8fdb\u7a0b\u7ec4\u3002 \u5982\u679c\u672a\u6307\u5b9a\u4fe1\u53f7\uff0c\u5219\u53d1\u9001TERM\u4fe1\u53f7\u3002 TERM\u4fe1\u53f7\u5c06\u6740\u6b7b\u4e0d\u6355\u83b7\u8be5\u4fe1\u53f7\u7684\u8fdb\u7a0b\u3002 \u5bf9\u4e8e\u5176\u4ed6\u8fc7\u7a0b\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528KILL\uff089\uff09\u4fe1\u53f7\uff0c\u56e0\u4e3a\u65e0\u6cd5\u6355\u83b7\u8be5\u4fe1\u53f7\u3002<\/p>\n<p>kill\u53c2\u6570\u683c\u5f0f<br \/>\nkill [-s signal|-p] [-q sigval] [-a] [&#8211;] pid&#8230;<br \/>\nkill -l [signal]<br \/>\nkill\u547d\u4ee4\u53c2\u6570<br \/>\n-l \u4fe1\u53f7\uff0c\u82e5\u679c\u4e0d\u52a0\u4fe1\u53f7\u7684\u7f16\u53f7\u53c2\u6570\uff0c\u5219\u4f7f\u7528\u201c-l\u201d\u53c2\u6570\u4f1a\u5217\u51fa\u5168\u90e8\u7684\u4fe1\u53f7\u540d\u79f0<\/p>\n<p>-a \u5f53\u5904\u7406\u5f53\u524d\u8fdb\u7a0b\u65f6\uff0c\u4e0d\u9650\u5236\u547d\u4ee4\u540d\u548c\u8fdb\u7a0b\u53f7\u7684\u5bf9\u5e94\u5173\u7cfb<\/p>\n<p>-p \u6307\u5b9akill \u547d\u4ee4\u53ea\u6253\u5370\u76f8\u5173\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\uff0c\u800c\u4e0d\u53d1\u9001\u4efb\u4f55\u4fe1\u53f7<\/p>\n<p>-s \u6307\u5b9a\u53d1\u9001\u4fe1\u53f7<\/p>\n<p>-u \u6307\u5b9a\u7528\u6237<\/p>\n<p>kill\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u4fe1\u53f7<\/h1>\n<p>$ kill -l<br \/>\n1) SIGHUP     2) SIGINT   3) SIGQUIT  4) SIGILL   5) SIGTRAP<br \/>\n6) SIGABRT     7) SIGBUS   8) SIGFPE   9) SIGKILL 10) SIGUSR1<br \/>\n11) SIGSEGV    12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM<br \/>\n16) SIGSTKFLT    17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP<br \/>\n21) SIGTTIN    22) SIGTTOU 23) SIGURG  24) SIGXCPU 25) SIGXFSZ<br \/>\n26) SIGVTALRM    27) SIGPROF 28) SIGWINCH    29) SIGIO   30) SIGPWR<br \/>\n31) SIGSYS    34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3<br \/>\n38) SIGRTMIN+4    39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8<br \/>\n43) SIGRTMIN+9    44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13<br \/>\n48) SIGRTMIN+14    49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12<br \/>\n53) SIGRTMAX-11    54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7<br \/>\n58) SIGRTMAX-6    59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2<br \/>\n63) SIGRTMAX-1    64) SIGRTMAX<br \/>\n\u89e3\u91ca<br \/>\nHUP    1    \u7ec8\u7aef\u65ad\u7ebf<br \/>\nINT     2    \u4e2d\u65ad\uff08\u540c Ctrl + C\uff09<br \/>\nQUIT    3    \u9000\u51fa\uff08\u540c Ctrl + \\\uff09<br \/>\nTERM   15    \u7ec8\u6b62<br \/>\nKILL    9    \u5f3a\u5236\u7ec8\u6b62<br \/>\nCONT   18    \u7ee7\u7eed\uff08\u4e0eSTOP\u76f8\u53cd\uff0c fg\/bg\u547d\u4ee4\uff09<br \/>\nSTOP    19    \u6682\u505c\uff08\u540c Ctrl + Z\uff09<\/p>\n<p>kill -9 \u662f\u6211\u4eec\u4f7f\u7528\u7684\u6700\u591a\u7684\u4fe1\u53f7\uff0c\u5176\u5b9e\u8fd9\u79cd\u65b9\u5f0f\u4e00\u70b9\u4e5f\u4e0d\u4f18\u96c5\uff0c\u5e94\u8be5\u4f7f\u7528kill -15\u4fe1\u53f7\uff0c\u5927\u90e8\u5206\u7a0b\u5e8f\u63a5\u6536\u5230SIGTERM\u4fe1\u53f7\u540e\uff0c\u4f1a\u5148\u91ca\u653e\u81ea\u5df1\u7684\u8d44\u6e90\uff0c\u7136\u540e\u518d\u505c\u6b62\u3002\u4f46\u662f\u4e5f\u6709\u7a0b\u5e8f\u53ef\u80fd\u63a5\u6536\u4fe1\u53f7\u540e\uff0c\u505a\u4e00\u4e9b\u5176\u4ed6\u7684\u4e8b\u60c5\uff08\u5982\u679c\u7a0b\u5e8f\u6b63\u5728\u7b49\u5f85IO\uff0c\u53ef\u80fd\u5c31\u4e0d\u4f1a\u7acb\u9a6c\u505a\u51fa\u54cd\u5e94\uff0c\u7b49\u5230io\u5b8c\u6210\u540e\u5728\u7ed3\u675f\uff09\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0cSIGTERM\u591a\u534a\u662f\u4f1a\u88ab\u963b\u585e\u7684\u3002<\/p>\n<p>\u8bb2\u5230\u8fd9\u91cc\uff0clinux\u57fa\u672c\u6307\u4ee4\u5dee\u4e0d\u591a\u4e86\u591f\u7528\u4e86\uff0c\u5dee\u4e0d\u591a\u53ef\u4ee5\u4e0a\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u968f\u4fbf\u641e\u641e\u4e86\u3002\u4f46\u662f\u4e5f\u53ea\u662f\u7b80\u5355\u770b\u770b\uff0c\u66f4\u591a\u7684\u64cd\u4f5c\u6307\u4ee4\u8bf7\u770b\u8fdb\u9636\u90e8\u5206\u3002<\/p>\n<p>Linux\u8fdb\u9636\u6307\u4ee4<br \/>\nfind<br \/>\nfind\u4ecb\u7ecd<br \/>\nThe find utility recursively descends the directory tree for each path listed, evaluating an expression (composed of the primaries&#8221; andoperands&#8221; listed below) in terms of each file in the tree.<\/p>\n<p>find\u5b9e\u7528\u7a0b\u5e8f\u5bf9\u5217\u51fa\u7684\u6bcf\u4e2a\u8def\u5f84\u9012\u5f52\u5730\u904d\u5386\u76ee\u5f55\u6811\uff0c\u6839\u636e\u6811\u4e2d\u7684\u6bcf\u4e2a\u6587\u4ef6\u8ba1\u7b97\u8868\u8fbe\u5f0f(\u7531\u4e0b\u9762\u5217\u51fa\u7684\u201c\u521d\u9009\u201d\u548c\u201c\u64cd\u4f5c\u6570\u201d\u7ec4\u6210)\u3002<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u4f7f\u7528\u9891\u7387\u6781\u9ad8\uff0c\u5982\u679c\u5bf9\u8fd9\u4e2a\u547d\u4ee4\u4e86\u89e3\u5f88\u900f\u5f7b\uff0c\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u53ef\u4ee5\u4e8b\u534a\u529f\u500d\u3002\u8fd9\u4e2a\u547d\u4ee4\u7684\u53c2\u6570\u8f83\u591a\uff0c\u5e38\u7528\u7684\u53c2\u6570\u6211\u4f1a\u5728\u4e0b\u9762\u5e38\u7528\u53c2\u6570\u793a\u4f8b\u8bb2\u6e05\u695a<\/p>\n<p>find\u53c2\u6570\u683c\u5f0f<br \/>\nfind [-H | -L | -P] [-EXdsx] [-f path] path &#8230; [expression] find [-H | -L | -P] [-EXdsx] -f path [path &#8230;] [expression]<\/p>\n<p>find\u547d\u4ee4\u53c2\u6570<br \/>\n-print\uff1a find\u547d\u4ee4\u5c06\u5339\u914d\u7684\u6587\u4ef6\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u3002<\/p>\n<p>-exec\uff1a find\u547d\u4ee4\u5bf9\u5339\u914d\u7684\u6587\u4ef6\u6267\u884c\u8be5\u53c2\u6570\u6240\u7ed9\u51fa\u7684shell\u547d\u4ee4\u3002\u76f8\u5e94\u547d\u4ee4\u7684\u5f62\u5f0f\u4e3a&#8217;command&#8217; { } \\;\uff0c\u6ce8\u610f{  }\u548c\\\uff1b\u4e4b\u95f4\u7684\u7a7a\u683c\u3002<\/p>\n<p>-name  \u6309\u7167\u6587\u4ef6\u540d\u67e5\u627e\u6587\u4ef6\u3002<\/p>\n<p>-perm  \u6309\u7167\u6587\u4ef6\u6743\u9650\u6765\u67e5\u627e\u6587\u4ef6\u3002<\/p>\n<p>-prune \u4f7f\u7528\u8fd9\u4e00\u9009\u9879\u53ef\u4ee5\u4f7ffind\u547d\u4ee4\u4e0d\u5728\u5f53\u524d\u6307\u5b9a\u7684\u76ee\u5f55\u4e2d\u67e5\u627e\uff0c\u5982\u679c\u540c\u65f6\u4f7f\u7528-depth\u9009\u9879\uff0c\u90a3\u4e48-prune\u5c06\u88abfind\u547d\u4ee4\u5ffd\u7565\u3002<\/p>\n<p>-user  \u6309\u7167\u6587\u4ef6\u5c5e\u4e3b\u6765\u67e5\u627e\u6587\u4ef6\u3002<\/p>\n<p>-group \u6309\u7167\u6587\u4ef6\u6240\u5c5e\u7684\u7ec4\u6765\u67e5\u627e\u6587\u4ef6\u3002<\/p>\n<p>-mtime -n +n \u6309\u7167\u6587\u4ef6\u7684\u66f4\u6539\u65f6\u95f4\u6765\u67e5\u627e\u6587\u4ef6\uff0c &#8211; n\u8868\u793a\u6587\u4ef6\u66f4\u6539\u65f6\u95f4\u8ddd\u73b0\u5728n\u5929\u4ee5\u5185\uff0c+ n\u8868\u793a\u6587\u4ef6\u66f4\u6539\u65f6\u95f4\u8ddd\u73b0\u5728n\u5929\u4ee5\u524d\u3002find\u547d\u4ee4\u8fd8\u6709-atime\u548c-ctime \u9009\u9879\uff0c\u4f46\u5b83\u4eec\u90fd\u548c-m time\u9009\u9879\u3002<\/p>\n<p>-nogroup \u67e5\u627e\u65e0\u6709\u6548\u6240\u5c5e\u7ec4\u7684\u6587\u4ef6\uff0c\u5373\u8be5\u6587\u4ef6\u6240\u5c5e\u7684\u7ec4\u5728\/etc\/groups\u4e2d\u4e0d\u5b58\u5728\u3002<\/p>\n<p>-nouser  \u67e5\u627e\u65e0\u6709\u6548\u5c5e\u4e3b\u7684\u6587\u4ef6\uff0c\u5373\u8be5\u6587\u4ef6\u7684\u5c5e\u4e3b\u5728\/etc\/passwd\u4e2d\u4e0d\u5b58\u5728\u3002<\/p>\n<p>-newer file1 ! file2 \u67e5\u627e\u66f4\u6539\u65f6\u95f4\u6bd4\u6587\u4ef6file1\u65b0\u4f46\u6bd4\u6587\u4ef6file2\u65e7\u7684\u6587\u4ef6\u3002<\/p>\n<p>-type \u67e5\u627e\u67d0\u4e00\u7c7b\u578b\u7684\u6587\u4ef6\uff0c\u8bf8\u5982\uff1a<\/p>\n<p>b &#8211; \u5757\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n<p>d &#8211; \u76ee\u5f55\u3002<\/p>\n<p>c &#8211; \u5b57\u7b26\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n<p>p &#8211; \u7ba1\u9053\u6587\u4ef6\u3002<\/p>\n<p>l &#8211; \u7b26\u53f7\u94fe\u63a5\u6587\u4ef6\u3002<\/p>\n<p>f &#8211; \u666e\u901a\u6587\u4ef6\u3002<\/p>\n<p>-size n\uff1a[c] \u67e5\u627e\u6587\u4ef6\u957f\u5ea6\u4e3an\u5757\u7684\u6587\u4ef6\uff0c\u5e26\u6709c\u65f6\u8868\u793a\u6587\u4ef6\u957f\u5ea6\u4ee5\u5b57\u8282\u8ba1\u3002-depth\uff1a\u5728\u67e5\u627e\u6587\u4ef6\u65f6\uff0c\u9996\u5148\u67e5\u627e\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff0c\u7136\u540e\u518d\u5728\u5176\u5b50\u76ee\u5f55\u4e2d\u67e5\u627e\u3002<\/p>\n<p>-fstype\uff1a\u67e5\u627e\u4f4d\u4e8e\u67d0\u4e00\u7c7b\u578b\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b\u901a\u5e38\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\/etc\/fstab\u4e2d\u627e\u5230\uff0c\u8be5\u914d\u7f6e\u6587\u4ef6\u4e2d\u5305\u542b\u4e86\u672c\u7cfb\u7edf\u4e2d\u6709\u5173\u6587\u4ef6\u7cfb\u7edf\u7684\u4fe1\u606f\u3002<\/p>\n<p>-mount\uff1a\u5728\u67e5\u627e\u6587\u4ef6\u65f6\u4e0d\u8de8\u8d8a\u6587\u4ef6\u7cfb\u7edfmount\u70b9\u3002<\/p>\n<p>-follow\uff1a\u5982\u679cfind\u547d\u4ee4\u9047\u5230\u7b26\u53f7\u94fe\u63a5\u6587\u4ef6\uff0c\u5c31\u8ddf\u8e2a\u81f3\u94fe\u63a5\u6240\u6307\u5411\u7684\u6587\u4ef6\u3002<\/p>\n<p>-cpio\uff1a\u5bf9\u5339\u914d\u7684\u6587\u4ef6\u4f7f\u7528cpio\u547d\u4ee4\uff0c\u5c06\u8fd9\u4e9b\u6587\u4ef6\u5907\u4efd\u5230\u78c1\u5e26\u8bbe\u5907\u4e2d\u3002<\/p>\n<p>\u53e6\u5916,\u4e0b\u9762\u4e09\u4e2a\u7684\u533a\u522b:<\/p>\n<p>-amin n  \u67e5\u627e\u7cfb\u7edf\u4e2d\u6700\u540eN\u5206\u949f\u8bbf\u95ee\u7684\u6587\u4ef6<\/p>\n<p>-atime n \u67e5\u627e\u7cfb\u7edf\u4e2d\u6700\u540en*24\u5c0f\u65f6\u8bbf\u95ee\u7684\u6587\u4ef6<\/p>\n<p>-cmin n  \u67e5\u627e\u7cfb\u7edf\u4e2d\u6700\u540eN\u5206\u949f\u88ab\u6539\u53d8\u6587\u4ef6\u72b6\u6001\u7684\u6587\u4ef6<\/p>\n<p>-ctime n \u67e5\u627e\u7cfb\u7edf\u4e2d\u6700\u540en*24\u5c0f\u65f6\u88ab\u6539\u53d8\u6587\u4ef6\u72b6\u6001\u7684\u6587\u4ef6<\/p>\n<p>-mmin n  \u67e5\u627e\u7cfb\u7edf\u4e2d\u6700\u540eN\u5206\u949f\u88ab\u6539\u53d8\u6587\u4ef6\u6570\u636e\u7684\u6587\u4ef6<\/p>\n<p>-mtime n \u67e5\u627e\u7cfb\u7edf\u4e2d\u6700\u540en*24\u5c0f\u65f6\u88ab\u6539\u53d8\u6587\u4ef6\u6570\u636e\u7684\u6587\u4ef6<\/p>\n<p>find\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n-name\u53c2\u6570\u5e38\u7528\u53c2\u6570\u793a\u4f8b \u67e5\u627e\/user\u76ee\u5f55\u4e0b\u6240\u6709\u4ee5.log\u7ed3\u5c3e\u7684\u6587\u4ef6<\/p>\n<p>\u56fe\u7247<br \/>\nimage-20191225235202419<br \/>\n-exec \u53c2\u6570\u540e\u9762\u8ddf\u7684\u662fcommand\uff0c\u5b83\u7684\u7ec8\u6b62\u662f\u4ee5;\u4e3a\u7ed3\u675f\u6807\u5fd7\u7684\uff0c\u6240\u4ee5\u8fd9\u53e5\u547d\u4ee4\u540e\u9762\u7684\u5206\u53f7\u662f\u4e0d\u53ef\u7f3a\u5c11\u7684\uff0c\u8003\u8651\u5230\u5404\u4e2a\u7cfb\u7edf\u4e2d\u5206\u53f7\u4f1a\u6709\u4e0d\u540c\u7684\u610f\u4e49\uff0c\u6240\u4ee5\u524d\u9762\u52a0\u53cd\u659c\u6760\u3002<\/p>\n<p>\u4e3e\u4e00\u4e2a\u6211\u5728\u5de5\u4f5c\u4e2d\u7ecf\u5e38\u7528\u5230\u7684\u4f8b\u5b50\uff0c\u6211\u6709\u4e2a\u65e5\u5fd7\u76ee\u5f55\uff0c\u6211\u7cfb\u7edf\u7684\u6240\u6709\u65e5\u5fd7\u90fd\u4f1a\u6253\u5230\u8fd9\u4e2a\u76ee\u5f55\uff0c\u76ee\u5f55\u7684\u65e5\u5fd7\u6587\u4ef6\u547d\u540d\u5f88\u968f\u610f\uff0c\u6211\u6ca1\u529e\u6cd5\u8bf4\u6839\u636e\u540d\u5b57\u5220\u9664\uff0c\u4e8e\u662f\u6211\u60f3\u5230\u7528\u65e5\u671f\u7684\u65b9\u5f0f\u5220\u9664\uff0c\u4fdd\u5b58\u4e00\u4e2a\u6708\u7684\u65e5\u5fd7\u5373\u53ef\u3002<\/p>\n<p>$find \/home\/midou\/logs\/\/ -mtime +30 -name &quot;*.log.gz&quot; -exec rm -rf {} \\;<\/p>\n<h1>{} \u8fd9\u4e2a\u662f\u8bed\u6cd5\u4e0d\u80fd\u4e22\u4e86 \uff0c\u8fd8\u6709\u7ed3\u5c3e\u7684 \uff1b \u4e5f\u4e0d\u80fd\u4e22\u4e86\u3002<\/h1>\n<p>\u5176\u5b9e\u6211\u628a\u8fd9\u4e2a\u547d\u4ee4\u653e\u5728\u6211\u7684\u4e00\u4e2a\u7cfb\u7edfcrontab\u6587\u4ef6\u91cc\u9762\uff0c\u6bcf\u5929\u6267\u884c\u4e00\u6b21\uff0c\u8fd9\u6837\u6211\u7684\u65e5\u5fd7\u76ee\u5f55\u5c31\u4e0d\u7528\u4e86\u624b\u52a8\u6e05\u7406\u3002corntab\u4f7f\u7528\u8be6\u89e3\u5728\u540e\u9762\u7684\u547d\u4ee4\u4e2d\u4f1a\u8bb2\u5230\u3002<\/p>\n<p>\u2003-exec \u540e\u9762\u53ef\u4ee5\u63a5\u4efb\u4f55\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u7075\u6d3b\u8fd0\u7528\uff0c\u518d\u7ed3\u5408\u5230\u524d\u9762\u7684-name\u53c2\u6570\uff0c\u53ef\u4ee5\u73a9\u51fa\u82b1\u6765\u3002<\/p>\n<p>grep<br \/>\ngrep\u4ecb\u7ecd<br \/>\nThe grep utility searches any given input files, selecting lines that match one or more patterns.  By default, a pattern matches an input line if the regular expression (RE) in the pattern matches the input line without its trailing newline.  An empty expression matches every line.  Each input line that matches at least one of the patterns is written to the standard output<\/p>\n<p>grep\u5b9e\u7528\u7a0b\u5e8f\u641c\u7d22\u4efb\u4f55\u7ed9\u5b9a\u7684\u8f93\u5165\u6587\u4ef6\uff0c\u9009\u62e9\u4e0e\u4e00\u4e2a\u6216\u591a\u4e2a\u6a21\u5f0f\u5339\u914d\u7684\u884c\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u6a21\u5f0f\u4e2d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff08RE\uff09\u5339\u914d\u8f93\u5165\u884c\u800c\u6ca1\u6709\u5c3e\u968f\u6362\u884c\u7b26\uff0c\u5219\u8be5\u6a21\u5f0f\u4f1a\u5339\u914d\u8f93\u5165\u884c\u3002 \u7a7a\u8868\u8fbe\u5f0f\u5339\u914d\u6bcf\u884c\u3002 \u4e0e\u81f3\u5c11\u4e00\u79cd\u6a21\u5f0f\u5339\u914d\u7684\u6bcf\u6761\u8f93\u5165\u7ebf\u5747\u5199\u5165\u6807\u51c6\u8f93\u51fa<\/p>\n<p>\u2003\u8fd9\u662f\u4e2a\u6211\u6bcf\u5929\u90fd\u4f1a\u7528\u5230\u7684\u547d\u4ee4\uff0c\u6211\u662f\u505a\u57fa\u7840\u670d\u52a1\u7684\uff0c\u7528\u6211\u670d\u52a1\u7684\u4eba\u4e0d\u514d\u4f1a\u9047\u5230\u95ee\u9898\uff0c\u8fd9\u65f6\u5019\u6211\u5c31\u53bb\u8981\u53bb\u770b\u65e5\u5fd7\u4e86\uff0c\u65e5\u5fd7\u90fd\u662fG\u7ea7\u522b\u7684\uff0c\u5f53\u7136\u4e0d\u80fd\u7528vim\u6253\u5f00\u53bb\u641c\u7d22\uff0c\u4f1a\u628a\u7cfb\u7edf\u6302\u6389\uff0cvim\u662f\u5168\u90e8\u6587\u6863\u52a0\u8f7d\u5230\u5185\u5b58\u3002\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u4f7f\u7528grep\u547d\u4ee4\u53bb\u6839\u636e\u4e00\u4e9b\u5173\u952e\u4fe1\u606f\u5339\u914d\u67e5\u627e\u4e86\u3002\uff08\u5f53\u7136\u6709\u4e9b\u540c\u5b66\u53ef\u80fd\u4f1a\u8bf4\uff0c\u65e2\u7136\u7ecf\u5e38\u67e5\u65e5\u5fd7\u7684\u8bdd\uff0c\u5c31\u4e0d\u80fd\u628a\u65e5\u5fd7\u63a5\u5165\u5230ElasticSearch\u8fd9\u79cd\u53ef\u641c\u7d22\u7684\u7ec4\u5efa\u4e2d\uff0c\u5f88\u597d\uff0c\u7528\u6280\u672f\u53bb\u89e3\u51b3\u5b9e\u9645\u95ee\u9898\u3002\u6211\u4eec\u4e5f\u662f\u8fd9\u6837\u505a\u7684\uff0c\u4f46\u603b\u514d\u4e0d\u4e86\u8fd8\u662f\u4f1a\u53bb\u670d\u52a1\u5668\u4e0a\u67e5\u4e00\u4e0b\u65e5\u5fd7\uff0c\u5b66\u4f1a\u8fd9\u4e2a\u547d\u4ee4\u6ca1\u9519\u7684\uff09<\/p>\n<p>grep\u53c2\u6570\u683c\u5f0f<br \/>\ngrep [-abcdDEFGHhIiJLlmnOopqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [&#8211;binary-files=value] [&#8211;color[=when]] [&#8211;colour[=when]][&#8211;context[=num]] [&#8211;label] [&#8211;line-buffered] [&#8211;null] [pattern] [file &#8230;]<\/p>\n<p>grep\u547d\u4ee4\u53c2\u6570<br \/>\n-a  &#8211;text  \u4e0d\u8981\u5ffd\u7565\u4e8c\u8fdb\u5236\u7684\u6570\u636e\u3002<\/p>\n<p>-A&lt;\u663e\u793a\u884c\u6570&gt;  &#8211;after-context=&lt;\u663e\u793a\u884c\u6570&gt;  #\u9664\u4e86\u663e\u793a\u7b26\u5408\u8303\u672c\u6837\u5f0f\u7684\u90a3\u4e00\u5217\u4e4b\u5916\uff0c\u5e76\u663e\u793a\u8be5\u884c\u4e4b\u540e\u7684\u5185\u5bb9\u3002<\/p>\n<p>-b  &#8211;byte-offset  #\u5728\u663e\u793a\u7b26\u5408\u6837\u5f0f\u7684\u90a3\u4e00\u884c\u4e4b\u524d\uff0c\u6807\u793a\u51fa\u8be5\u884c\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7f16\u53f7\u3002<\/p>\n<p>-B&lt;\u663e\u793a\u884c\u6570&gt;  &#8211;before-context=&lt;\u663e\u793a\u884c\u6570&gt;  #\u9664\u4e86\u663e\u793a\u7b26\u5408\u6837\u5f0f\u7684\u90a3\u4e00\u884c\u4e4b\u5916\uff0c\u5e76\u663e\u793a\u8be5\u884c\u4e4b\u524d\u7684\u5185\u5bb9\u3002<\/p>\n<p>-c  &#8211;count  #\u8ba1\u7b97\u7b26\u5408\u6837\u5f0f\u7684\u5217\u6570\u3002<\/p>\n<p>-C&lt;\u663e\u793a\u884c\u6570&gt;  &#8211;context=&lt;\u663e\u793a\u884c\u6570&gt;\u6216-&lt;\u663e\u793a\u884c\u6570&gt;  #\u9664\u4e86\u663e\u793a\u7b26\u5408\u6837\u5f0f\u7684\u90a3\u4e00\u884c\u4e4b\u5916\uff0c\u5e76\u663e\u793a\u8be5\u884c\u4e4b\u524d\u540e\u7684\u5185\u5bb9\u3002<\/p>\n<p>-d &lt;\u52a8\u4f5c&gt;   &#8211;directories=&lt;\u52a8\u4f5c&gt;  #\u5f53\u6307\u5b9a\u8981\u67e5\u627e\u7684\u662f\u76ee\u5f55\u800c\u975e\u6587\u4ef6\u65f6\uff0c\u5fc5\u987b\u4f7f\u7528\u8fd9\u9879\u53c2\u6570\uff0c\u5426\u5219grep\u6307\u4ee4\u5c06\u56de\u62a5\u4fe1\u606f\u5e76\u505c\u6b62\u52a8\u4f5c\u3002<\/p>\n<p>-e&lt;\u8303\u672c\u6837\u5f0f&gt; &#8211;regexp=&lt;\u8303\u672c\u6837\u5f0f&gt;  #\u6307\u5b9a\u5b57\u7b26\u4e32\u505a\u4e3a\u67e5\u627e\u6587\u4ef6\u5185\u5bb9\u7684\u6837\u5f0f\u3002<\/p>\n<p>-E   &#8211;extended-regexp  #\u5c06\u6837\u5f0f\u4e3a\u5ef6\u4f38\u7684\u666e\u901a\u8868\u793a\u6cd5\u6765\u4f7f\u7528\u3002<\/p>\n<p>-f&lt;\u89c4\u5219\u6587\u4ef6&gt; &#8211;file=&lt;\u89c4\u5219\u6587\u4ef6&gt;  #\u6307\u5b9a\u89c4\u5219\u6587\u4ef6\uff0c\u5176\u5185\u5bb9\u542b\u6709\u4e00\u4e2a\u6216\u591a\u4e2a\u89c4\u5219\u6837\u5f0f\uff0c\u8ba9grep\u67e5\u627e\u7b26\u5408\u89c4\u5219\u6761\u4ef6\u7684\u6587\u4ef6\u5185\u5bb9\uff0c\u683c\u5f0f\u4e3a\u6bcf\u884c\u4e00\u4e2a\u89c4\u5219\u6837\u5f0f\u3002<\/p>\n<p>-F  &#8211;fixed-regexp  #\u5c06\u6837\u5f0f\u89c6\u4e3a\u56fa\u5b9a\u5b57\u7b26\u4e32\u7684\u5217\u8868\u3002<\/p>\n<p>-G  &#8211;basic-regexp  #\u5c06\u6837\u5f0f\u89c6\u4e3a\u666e\u901a\u7684\u8868\u793a\u6cd5\u6765\u4f7f\u7528\u3002<\/p>\n<p>-h  &#8211;no-filename  #\u5728\u663e\u793a\u7b26\u5408\u6837\u5f0f\u7684\u90a3\u4e00\u884c\u4e4b\u524d\uff0c\u4e0d\u6807\u793a\u8be5\u884c\u6240\u5c5e\u7684\u6587\u4ef6\u540d\u79f0\u3002<\/p>\n<p>-H  &#8211;with-filename  #\u5728\u663e\u793a\u7b26\u5408\u6837\u5f0f\u7684\u90a3\u4e00\u884c\u4e4b\u524d\uff0c\u8868\u793a\u8be5\u884c\u6240\u5c5e\u7684\u6587\u4ef6\u540d\u79f0\u3002<\/p>\n<p>-i  &#8211;ignore-case  #\u5ffd\u7565\u5b57\u7b26\u5927\u5c0f\u5199\u7684\u5dee\u522b\u3002<\/p>\n<p>-l  &#8211;file-with-matches  #\u5217\u51fa\u6587\u4ef6\u5185\u5bb9\u7b26\u5408\u6307\u5b9a\u7684\u6837\u5f0f\u7684\u6587\u4ef6\u540d\u79f0\u3002<\/p>\n<p>-L  &#8211;files-without-match  #\u5217\u51fa\u6587\u4ef6\u5185\u5bb9\u4e0d\u7b26\u5408\u6307\u5b9a\u7684\u6837\u5f0f\u7684\u6587\u4ef6\u540d\u79f0\u3002<\/p>\n<p>-n  &#8211;line-number  #\u5728\u663e\u793a\u7b26\u5408\u6837\u5f0f\u7684\u90a3\u4e00\u884c\u4e4b\u524d\uff0c\u6807\u793a\u51fa\u8be5\u884c\u7684\u5217\u6570\u7f16\u53f7\u3002<\/p>\n<p>-q  &#8211;quiet\u6216&#8211;silent  #\u4e0d\u663e\u793a\u4efb\u4f55\u4fe1\u606f\u3002<\/p>\n<p>-r  &#8211;recursive  #\u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a\u201c-d recurse\u201d\u53c2\u6570\u76f8\u540c\u3002<\/p>\n<p>-s  &#8211;no-messages  #\u4e0d\u663e\u793a\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<p>-v  &#8211;revert-match  #\u663e\u793a\u4e0d\u5305\u542b\u5339\u914d\u6587\u672c\u7684\u6240\u6709\u884c\u3002<\/p>\n<p>-V  &#8211;version  #\u663e\u793a\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<p>-w  &#8211;word-regexp  #\u53ea\u663e\u793a\u5168\u5b57\u7b26\u5408\u7684\u5217\u3002<\/p>\n<p>-x  &#8211;line-regexp  #\u53ea\u663e\u793a\u5168\u5217\u7b26\u5408\u7684\u5217\u3002<\/p>\n<p>-y  \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a\u201c-i\u201d\u53c2\u6570\u76f8\u540c\u3002<\/p>\n<p>grep\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$grep &#8217;20:[1-5][0-9]:&#8217; *.log  #\u5339\u914d\u5f53\u524d\u76ee\u5f55\u4e0b\u641c\u7d22log\u65e5\u5fd7\u4e2d\uff0c20\u70b9\u7684\u65e5\u5fd7<br \/>\n$grep &#8217;20:[1-5][0-9]&#8217; 1.log 2.log 3.log  #\u6307\u5b9a\u5728\u8fd9\u4e09\u4e2a\u6587\u4ef6\u4e2d\u67e5\u627e<\/p>\n<h1>grep\u89c4\u5219\u662f\u652f\u6301\u6b63\u5219\u8868\u8fbe\u5f0f\u7684<\/h1>\n<p>$ps -ef|grep java    #\u67e5\u627e\u6240\u6709java\u8fdb\u7a0b<br \/>\n$ps -ef|grep java    #-c\u53ef\u4ee5\u7edf\u8ba1\u67e5\u627e\u7684\u4e2a\u6570<br \/>\n$grep &#8217;20:[1-5][0-9]:&#8217; <em>.log | grep -v &#8217;20:[3-4][0-9]:&#8217;   # -v\u53cd\u5411\u9009\u62e9\uff0c\u76f8\u5f53\u4e8e\u8fc7\u6ee4<br \/>\n$grep &#8216;ab|bc&#8217; <\/em>.log  #\u652f\u6301|\u8bed\u6cd5\uff0c\u5339\u914d\u542b\u6709ab\u6216\u8005bc\u7684\u6587\u672c\u884c<br \/>\n\u2003\u638c\u63e1grep\u7684\u5e38\u7528\u53c2\u6570\uff0c\u4f1a\u8ba9\u4f60\u67e5\u627e\u65e5\u5fd7\u6216\u8005\u5185\u5bb9\u975e\u5e38\u8f7b\u677e\u3002\u7279\u522b\u662f\u5f53\u4f60\u6570\u636e\u91cf\u5f88\u5927\u7684\u65f6\u5019\uff0c\u6ca1\u529e\u6cd5\u4f7f\u7528vi\u6216\u8005vim\u6253\u5f00\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n<p>cut<br \/>\ncut\u4ecb\u7ecd<br \/>\n\u2003\u8fd9\u4e2a\u547d\u4ee4\u5bf9\u6211\u6765\u8bf4\u5f88\u6709\u6545\u4e8b\uff0c\u5f53\u65f6\u6211\u5728\u5b66\u5b8cC\u8bed\u8a00\uff0c\u7b80\u5355\u4e86\u89e3\u4e86\u4e9blinux\u4e0a\u7684\u57fa\u672c\u547d\u4ee4\uff0c\u6709\u6b21\u5b9e\u4e60\u9762\u8bd5\uff0c\u9762\u8bd5\u5b98\u95ee\u6211linux\u7cfb\u7edf\u7528\u8fc7\u4e48\uff0c\u6211\u65a9\u9489\u622a\u94c1\u7684\u8bf4\u7528\u8fc7\uff0c\u9762\u8bd5\u5b98\u7b80\u5355\u7684\u7528vim\u5199\u4e86\u4e00\u884chello world\u3002\u5bf9\u6211\u8bf4\uff0c\u4f60\u600e\u6837\u901a\u8fc7linux\u547d\u4ee4\u5427\u8fd9\u4e2a\u6587\u672c\u91cc\u9762\u7684hello world\u641e\u6210\u5341\u884c\uff0c\u5e76\u4e14\u53d6\u51fa\u6bcf\u4e00\u5217\u7684\u7b2c\u4e03\u4e2a\u5b57\u7b26\u3002<\/p>\n<p>\u5f53\u65f6\u7684\u6211\u771f\u7684\u662f\u5fc3\u91cc\u4e00\u7fa4\u8349\u6ce5\u9a6c\u8dd1\u8fc7\uff0c\u8fd9\u53ef\u96be\u9053\u6211\u4e86\uff0c\u6211\u6c89\u601d\u4e86\u7247\u523b\uff0c\u8bf4\u53ea\u8981\u5341\u884c\u4e48\uff1f\u591a\u70b9\u884c\u4e48\uff1f\u3002\u5f53\u7136\u4e0d\u884c\uff0c\u53ea\u8981\u5341\u884c\uff0c\u53d6\u6bcf\u884c\u7684\u7b2c\u4e03\u4e2a\u5b57\u7b26\u7eed\u6c89\u601d\u4e86\u7247\u523b\uff0c\u62ff\u8d77\u9762\u8bd5\u5b98\u7684\u7535\u8111\u5c31\u662f\u4e00\u987f\u64cd\u4f5c\uff0c\u4e8e\u662f\u6709\u4e86\u6211\u8bb0\u5fc6\u6df1\u523b\u7684\u4e0b\u9762\u8fd9\u4e00\u884c\u547d\u4ee4\u3002<\/p>\n<p>$ cat tmp.cc| &gt;&gt;tmp.cc|&gt;&gt;tmp.cc|&gt;&gt;tmp.cc|head -n10|&gt;tmp.cc|cut -c7-7<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\nw<br \/>\n\u2003\u9762\u8bd5\u5b98\u4e00\u770b\uff0c\u5fae\u5fae\u70b9\u4e86\u4e0b\u5934(\u80af\u5b9a\u5728\u5fc3\u91cc\u9ed8\u5ff5\uff0c\u5c0f\u4f19\u5b50\uff0c\u4e0d\u9519\u554a)\u3002\u6240\u4ee5\u8fd9\u4e2a\u547d\u4ee4\u6211\u5370\u8c61\u86ee\u6df1\u523b\u7684\u3002\u5f53\u7136\u8fd8\u8981\u5176\u4ed6\u65b9\u5f0f\u5b9e\u73b0\u9762\u8bd5\u5b98\u7684\u8981\u6c42\uff0c\u6bd4\u5982cut\u7b2c\u4e03\u4e2a\u5730\u5e9c\uff0c\u5199\u4e2a\u5faa\u73af\u91cd\u5b9a\u5411\u5230\u7ba1\u9053\uff0c\u518d\u5230\u539f\u6587\u4ef6\u3002<\/p>\n<p>The cut utility cuts out selected portions of each line (as specified by list) from each file and writes them to the standard output.  If no file arguments are specified, or a file argument is a single dash (`-&#8216;), cut reads from the standard input.  The items specified by list can be in terms of column position or in terms of fields delimited by a special character.  Column numbering starts from 1.<\/p>\n<p>cut\u5b9e\u7528\u7a0b\u5e8f\u4ece\u6bcf\u4e2a\u6587\u4ef6\u4e2d\u526a\u5207\u51fa\u6bcf\u884c\u7684\u9009\u5b9a\u90e8\u5206\uff08\u7531\u5217\u8868\u6307\u5b9a\uff09\uff0c\u5e76\u5c06\u5b83\u4eec\u5199\u5165\u6807\u51c6\u8f93\u51fa\u3002 \u5982\u679c\u672a\u6307\u5b9a\u6587\u4ef6\u53c2\u6570\uff0c\u6216\u8005\u6587\u4ef6\u53c2\u6570\u4e3a\u5355\u7834\u6298\u53f7\uff08-\uff09\uff0c\u5219\u4ece\u6807\u51c6\u8f93\u5165\u4e2d\u8bfb\u53d6\u5185\u5bb9\u3002 \u5217\u8868\u6307\u5b9a\u7684\u9879\u76ee\u53ef\u4ee5\u662f\u5217\u4f4d\u7f6e\uff0c\u4e5f\u53ef\u4ee5\u662f\u7531\u7279\u6b8a\u5b57\u7b26\u5206\u9694\u7684\u5b57\u6bb5\u3002 \u5217\u7f16\u53f7\u4ece1\u5f00\u59cb\u3002<\/p>\n<p>cut\u53c2\u6570\u683c\u5f0f<br \/>\ncut -b list [-n] [file &#8230;] cut -c list [file &#8230;] cut -f list [-d delim] [-s] [file &#8230;]<\/p>\n<p>cut\u547d\u4ee4\u53c2\u6570<br \/>\n-b\uff1a\u4ec5\u663e\u793a\u884c\u4e2d\u6307\u5b9a\u76f4\u63a5\u8303\u56f4\u7684\u5185\u5bb9\uff1b<\/p>\n<p>-c\uff1a\u4ec5\u663e\u793a\u884c\u4e2d\u6307\u5b9a\u8303\u56f4\u7684\u5b57\u7b26\uff1b<\/p>\n<p>-d\uff1a\u6307\u5b9a\u5b57\u6bb5\u7684\u5206\u9694\u7b26\uff0c\u9ed8\u8ba4\u7684\u5b57\u6bb5\u5206\u9694\u7b26\u4e3a\u201cTAB\u201d\uff1b<\/p>\n<p>-f\uff1a\u663e\u793a\u6307\u5b9a\u5b57\u6bb5\u7684\u5185\u5bb9\uff1b<\/p>\n<p>-n\uff1a\u4e0e\u201c-b\u201d\u9009\u9879\u8fde\u7528\uff0c\u4e0d\u5206\u5272\u591a\u5b57\u8282\u5b57\u7b26\uff1b<\/p>\n<p>&#8211;complement\uff1a\u8865\u8db3\u88ab\u9009\u62e9\u7684\u5b57\u8282\u3001\u5b57\u7b26\u6216\u5b57\u6bb5\uff1b<\/p>\n<p>&#8211;out-delimiter=&lt;\u5b57\u6bb5\u5206\u9694\u7b26&gt;\uff1a\u6307\u5b9a\u8f93\u51fa\u5185\u5bb9\u662f\u7684\u5b57\u6bb5\u5206\u5272\u7b26\uff1b<\/p>\n<p>cut\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$cut -c-10 tmp.txt  #cut tmp.txt\u6587\u4ef6\u7684\u524d10\u5217<br \/>\n$cut -c3-5 tmp.txt  #cut tmp.txt\u6587\u4ef6\u7684\u7b2c3\u52305\u5217<br \/>\n$cut -c3- tmp.txt  #cut tmp.txt\u6587\u4ef6\u7684\u7b2c3\u5230\u7ed3\u5c3e\u5217<br \/>\ndiff<br \/>\ndiff\u4ecb\u7ecd<br \/>\nCompare files line by line.<\/p>\n<p>\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u4e0d\u540c<\/p>\n<p>diff\u53c2\u6570\u683c\u5f0f<br \/>\ndiff [OPTION]&#8230; FILES<\/p>\n<p>diff\u547d\u4ee4\u53c2\u6570<br \/>\n-b\u6216&#8211;ignore-space-change \u4e0d\u68c0\u67e5\u7a7a\u683c\u5b57\u7b26\u7684\u4e0d\u540c\u3002<\/p>\n<p>-B\u6216&#8211;ignore-blank-lines \u4e0d\u68c0\u67e5\u7a7a\u767d\u884c\u3002<\/p>\n<p>-c \u663e\u793a\u5168\u90e8\u5185\u6587\uff0c\u5e76\u6807\u51fa\u4e0d\u540c\u4e4b\u5904\u3002<\/p>\n<p>-C\u6216&#8211;context \u4e0e\u6267\u884c&quot;-c-&quot;\u6307\u4ee4\u76f8\u540c\u3002<\/p>\n<p>-d\u6216&#8211;minimal \u4f7f\u7528\u4e0d\u540c\u7684\u6f14\u7b97\u6cd5\uff0c\u4ee5\u8f83\u5c0f\u7684\u5355\u4f4d\u6765\u505a\u6bd4\u8f83\u3002<\/p>\n<p>-D\u6216ifdef \u6b64\u53c2\u6570\u7684\u8f93\u51fa\u683c\u5f0f\u53ef\u7528\u4e8e\u524d\u7f6e\u5904\u7406\u5668\u5de8\u96c6\u3002<\/p>\n<p>-e\u6216&#8211;ed \u6b64\u53c2\u6570\u7684\u8f93\u51fa\u683c\u5f0f\u53ef\u7528\u4e8eed\u7684script\u6587\u4ef6\u3002<\/p>\n<p>-f\u6216-forward-ed \u8f93\u51fa\u7684\u683c\u5f0f\u7c7b\u4f3ced\u7684script\u6587\u4ef6\uff0c\u4f46\u6309\u7167\u539f\u6765\u6587\u4ef6\u7684\u987a\u5e8f\u6765\u663e\u793a\u4e0d\u540c\u5904\u3002<\/p>\n<p>-H\u6216&#8211;speed-large-files \u6bd4\u8f83\u5927\u6587\u4ef6\u65f6\uff0c\u53ef\u52a0\u5feb\u901f\u5ea6\u3002<\/p>\n<p>-l\u6216&#8211;ignore-matching-lines \u82e5\u4e24\u4e2a\u6587\u4ef6\u5728\u67d0\u51e0\u884c\u6709\u6240\u4e0d\u540c\uff0c\u800c\u8fd9\u51e0\u884c\u540c\u65f6\u90fd\u5305\u542b\u4e86\u9009\u9879\u4e2d\u6307\u5b9a\u7684\u5b57\u7b26\u6216\u5b57\u7b26\u4e32\uff0c\u5219\u4e0d\u663e\u793a\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u5dee\u5f02\u3002<\/p>\n<p>-i\u6216&#8211;ignore-case \u4e0d\u68c0\u67e5\u5927\u5c0f\u5199\u7684\u4e0d\u540c\u3002<\/p>\n<p>-l\u6216&#8211;paginate \u5c06\u7ed3\u679c\u4ea4\u7531pr\u7a0b\u5e8f\u6765\u5206\u9875\u3002<\/p>\n<p>-n\u6216&#8211;rcs \u5c06\u6bd4\u8f83\u7ed3\u679c\u4ee5RCS\u7684\u683c\u5f0f\u6765\u663e\u793a\u3002<\/p>\n<p>-N\u6216&#8211;new-file \u5728\u6bd4\u8f83\u76ee\u5f55\u65f6\uff0c\u82e5\u6587\u4ef6A\u4ec5\u51fa\u73b0\u5728\u67d0\u4e2a\u76ee\u5f55\u4e2d\uff0c\u9884\u8bbe\u4f1a\u663e\u793a\uff1aOnly in\u76ee\u5f55\uff1a\u6587\u4ef6A\u82e5\u4f7f\u7528-N\u53c2\u6570\uff0c\u5219diff\u4f1a\u5c06\u6587\u4ef6A\u4e0e\u4e00\u4e2a\u7a7a\u767d\u7684\u6587\u4ef6\u6bd4\u8f83\u3002<\/p>\n<p>-p \u82e5\u6bd4\u8f83\u7684\u6587\u4ef6\u4e3aC\u8bed\u8a00\u7684\u7a0b\u5e8f\u7801\u6587\u4ef6\u65f6\uff0c\u663e\u793a\u5dee\u5f02\u6240\u5728\u7684\u51fd\u6570\u540d\u79f0\u3002<\/p>\n<p>-P\u6216&#8211;unidirectional-new-file \u4e0e-N\u7c7b\u4f3c\uff0c\u4f46\u53ea\u6709\u5f53\u7b2c\u4e8c\u4e2a\u76ee\u5f55\u5305\u542b\u4e86\u4e00\u4e2a\u7b2c\u4e00\u4e2a\u76ee\u5f55\u6240\u6ca1\u6709\u7684\u6587\u4ef6\u65f6\uff0c\u624d\u4f1a\u5c06\u8fd9\u4e2a\u6587\u4ef6\u4e0e\u7a7a\u767d\u7684\u6587\u4ef6\u505a\u6bd4\u8f83\u3002<\/p>\n<p>-q\u6216&#8211;brief \u4ec5\u663e\u793a\u6709\u65e0\u5dee\u5f02\uff0c\u4e0d\u663e\u793a\u8be6\u7ec6\u7684\u4fe1\u606f\u3002<\/p>\n<p>-r\u6216&#8211;recursive \u6bd4\u8f83\u5b50\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3002<\/p>\n<p>-s\u6216&#8211;report-identical-files \u82e5\u6ca1\u6709\u53d1\u73b0\u4efb\u4f55\u5dee\u5f02\uff0c\u4ecd\u7136\u663e\u793a\u4fe1\u606f\u3002<\/p>\n<p>-S\u6216&#8211;starting-file \u5728\u6bd4\u8f83\u76ee\u5f55\u65f6\uff0c\u4ece\u6307\u5b9a\u7684\u6587\u4ef6\u5f00\u59cb\u6bd4\u8f83\u3002<\/p>\n<p>-t\u6216&#8211;expand-tabs \u5728\u8f93\u51fa\u65f6\uff0c\u5c06tab\u5b57\u7b26\u5c55\u5f00\u3002<\/p>\n<p>-T\u6216&#8211;initial-tab \u5728\u6bcf\u884c\u524d\u9762\u52a0\u4e0atab\u5b57\u7b26\u4ee5\u4fbf\u5bf9\u9f50\u3002<\/p>\n<p>-u,-U\u6216&#8211;unified= \u4ee5\u5408\u5e76\u7684\u65b9\u5f0f\u6765\u663e\u793a\u6587\u4ef6\u5185\u5bb9\u7684\u4e0d\u540c\u3002<\/p>\n<p>-v\u6216&#8211;version \u663e\u793a\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<p>-w\u6216&#8211;ignore-all-space \u5ffd\u7565\u5168\u90e8\u7684\u7a7a\u683c\u5b57\u7b26\u3002<\/p>\n<p>-W\u6216&#8211;width \u5728\u4f7f\u7528-y\u53c2\u6570\u65f6\uff0c\u6307\u5b9a\u680f\u5bbd\u3002<\/p>\n<p>-x\u6216&#8211;exclude \u4e0d\u6bd4\u8f83\u9009\u9879\u4e2d\u6240\u6307\u5b9a\u7684\u6587\u4ef6\u6216\u76ee\u5f55\u3002<\/p>\n<p>-X\u6216&#8211;exclude-from \u60a8\u53ef\u4ee5\u5c06\u6587\u4ef6\u6216\u76ee\u5f55\u7c7b\u578b\u5b58\u6210\u6587\u672c\u6587\u4ef6\uff0c\u7136\u540e\u5728=\u4e2d\u6307\u5b9a\u6b64\u6587\u672c\u6587\u4ef6\u3002<\/p>\n<p>-y\u6216&#8211;side-by-side \u4ee5\u5e76\u5217\u7684\u65b9\u5f0f\u663e\u793a\u6587\u4ef6\u7684\u5f02\u540c\u4e4b\u5904\u3002<\/p>\n<p>diff\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\n$ diff testA.txt testB.txt<br \/>\ntar&amp;gzip<br \/>\ntar\u4ecb\u7ecd<br \/>\n\u7528\u6765\u538b\u7f29\u548c\u89e3\u538b\u6587\u4ef6\u3002tar\u672c\u8eab\u4e0d\u5177\u6709\u538b\u7f29\u529f\u80fd\u3002\u4ed6\u662f\u8c03\u7528\u538b\u7f29\u529f\u80fd\u5b9e\u73b0\u7684<\/p>\n<p>tar\u53c2\u6570\u683c\u5f0f<br \/>\ntar [bundled-flags <args>] [<file> | <pattern> &#8230;]<br \/>\ntar {-c} [options] [files | directories]<br \/>\ntar {-r | -u} -f archive-file [options] [files | directories]<br \/>\ntar {-t | -x} [options] [patterns]<br \/>\ntar\u547d\u4ee4\u53c2\u6570<br \/>\n-A \u65b0\u589e\u538b\u7f29\u6587\u4ef6\u5230\u5df2\u5b58\u5728\u7684\u538b\u7f29<\/p>\n<p>-B \u8bbe\u7f6e\u533a\u5757\u5927\u5c0f<\/p>\n<p>-c \u5efa\u7acb\u65b0\u7684\u538b\u7f29\u6587\u4ef6<\/p>\n<p>-d \u8bb0\u5f55\u6587\u4ef6\u7684\u5dee\u522b<\/p>\n<p>-r \u6dfb\u52a0\u6587\u4ef6\u5230\u5df2\u7ecf\u538b\u7f29\u7684\u6587\u4ef6<\/p>\n<p>-u \u6dfb\u52a0\u6539\u53d8\u4e86\u548c\u73b0\u6709\u7684\u6587\u4ef6\u5230\u5df2\u7ecf\u5b58\u5728\u7684\u538b\u7f29\u6587\u4ef6<\/p>\n<p>-x \u4ece\u538b\u7f29\u7684\u6587\u4ef6\u4e2d\u63d0\u53d6\u6587\u4ef6<\/p>\n<p>-t \u663e\u793a\u538b\u7f29\u6587\u4ef6\u7684\u5185\u5bb9<\/p>\n<p>-z \u652f\u6301gzip\u89e3\u538b\u6587\u4ef6<\/p>\n<p>-j \u652f\u6301bzip2\u89e3\u538b\u6587\u4ef6<\/p>\n<p>-Z \u652f\u6301compress\u89e3\u538b\u6587\u4ef6<\/p>\n<p>-v \u663e\u793a\u64cd\u4f5c\u8fc7\u7a0b<\/p>\n<p>-l \u6587\u4ef6\u7cfb\u7edf\u8fb9\u754c\u8bbe\u7f6e<\/p>\n<p>-k \u4fdd\u7559\u539f\u6709\u6587\u4ef6\u4e0d\u8986\u76d6<\/p>\n<p>-m \u4fdd\u7559\u6587\u4ef6\u4e0d\u88ab\u8986\u76d6<\/p>\n<p>-W \u786e\u8ba4\u538b\u7f29\u6587\u4ef6\u7684\u6b63\u786e\u6027<\/p>\n<p>-b \u8bbe\u7f6e\u533a\u5757\u6570\u76ee<\/p>\n<p>-C \u5207\u6362\u5230\u6307\u5b9a\u76ee\u5f55<\/p>\n<p>-f \u6307\u5b9a\u538b\u7f29\u6587\u4ef6<\/p>\n<p>tar\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u6253\u5305  tar -cvf \u5305\u540d  \u6587\u4ef6\u540d<\/h1>\n<p>$tar -cvf test.tar test.txt <\/p>\n<h1>\u89e3\u5305  tar -xvf \u5305\u540d<\/h1>\n<p>$tar -xvf test.tar<\/p>\n<h1>\u538b\u7f29  tar -czvf \u5305\u540d \u6587\u4ef6\u540d<\/h1>\n<p>$tar -czvf test.tgz test.txt<\/p>\n<h1>\u89e3\u538b  tar -xzvf \u5305\u540d<\/h1>\n<p>$tar -xzvf test.tgz<br \/>\ndu<br \/>\ndu\u4ecb\u7ecd<br \/>\nThe du utility displays the file system block usage for each file argument and for each directory in the file hierarchy rooted in each directory argument.If no file is specified, the block usage of the hierarchy rooted in the current directory is displayed.<\/p>\n<p>du\u5b9e\u7528\u7a0b\u5e8f\u663e\u793a\u6bcf\u4e2a\u6587\u4ef6\u81ea\u53d8\u91cf\u4ee5\u53ca\u4ee5\u6bcf\u4e2a\u76ee\u5f55\u81ea\u53d8\u91cf\u4e3a\u6839\u7684\u6587\u4ef6\u5c42\u6b21\u7ed3\u6784\u4e2d\u6bcf\u4e2a\u76ee\u5f55\u7684\u6587\u4ef6\u7cfb\u7edf\u5757\u4f7f\u7528\u60c5\u51b5\u3002\u5982\u679c\u672a\u6307\u5b9a\u6587\u4ef6\uff0c\u5219\u663e\u793a\u4ee5\u5f53\u524d\u76ee\u5f55\u4e3a\u6839\u7684\u5c42\u6b21\u7ed3\u6784\u7684\u5757\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>du\u53c2\u6570\u683c\u5f0f<br \/>\ndu [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file &#8230;]<\/p>\n<p>du\u547d\u4ee4\u53c2\u6570<br \/>\n-a\u6216-all \u663e\u793a\u76ee\u5f55\u4e2d\u4e2a\u522b\u6587\u4ef6\u7684\u5927\u5c0f\u3002<\/p>\n<p>-b\u6216-bytes \u663e\u793a\u76ee\u5f55\u6216\u6587\u4ef6\u5927\u5c0f\u65f6\uff0c\u4ee5byte\u4e3a\u5355\u4f4d\u3002<\/p>\n<p>-c\u6216&#8211;total \u9664\u4e86\u663e\u793a\u4e2a\u522b\u76ee\u5f55\u6216\u6587\u4ef6\u7684\u5927\u5c0f\u5916\uff0c\u540c\u65f6\u4e5f\u663e\u793a\u6240\u6709\u76ee\u5f55\u6216\u6587\u4ef6\u7684\u603b\u548c\u3002<\/p>\n<p>-k\u6216&#8211;kilobytes \u4ee5KB(1024bytes)\u4e3a\u5355\u4f4d\u8f93\u51fa\u3002<\/p>\n<p>-m\u6216&#8211;megabytes \u4ee5MB\u4e3a\u5355\u4f4d\u8f93\u51fa\u3002<\/p>\n<p>-s\u6216&#8211;summarize \u4ec5\u663e\u793a\u603b\u8ba1\uff0c\u53ea\u5217\u51fa\u6700\u540e\u52a0\u603b\u7684\u503c\u3002<\/p>\n<p>-h\u6216&#8211;human-readable \u4ee5K\uff0cM\uff0cG\u4e3a\u5355\u4f4d\uff0c\u63d0\u9ad8\u4fe1\u606f\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n<p>-x\u6216&#8211;one-file-xystem \u4ee5\u4e00\u5f00\u59cb\u5904\u7406\u65f6\u7684\u6587\u4ef6\u7cfb\u7edf\u4e3a\u51c6\uff0c\u82e5\u9047\u4e0a\u5176\u5b83\u4e0d\u540c\u7684\u6587\u4ef6\u7cfb\u7edf\u76ee\u5f55\u5219\u7565\u8fc7\u3002<\/p>\n<p>-L&lt;\u7b26\u53f7\u94fe\u63a5&gt;\u6216&#8211;dereference&lt;\u7b26\u53f7\u94fe\u63a5&gt; \u663e\u793a\u9009\u9879\u4e2d\u6240\u6307\u5b9a\u7b26\u53f7\u94fe\u63a5\u7684\u6e90\u6587\u4ef6\u5927\u5c0f\u3002<\/p>\n<p>-S\u6216&#8211;separate-dirs  \u663e\u793a\u4e2a\u522b\u76ee\u5f55\u7684\u5927\u5c0f\u65f6\uff0c\u5e76\u4e0d\u542b\u5176\u5b50\u76ee\u5f55\u7684\u5927\u5c0f\u3002<\/p>\n<p>-X&lt;\u6587\u4ef6&gt;\u6216&#8211;exclude-from=&lt;\u6587\u4ef6&gt; \u5728&lt;\u6587\u4ef6&gt;\u6307\u5b9a\u76ee\u5f55\u6216\u6587\u4ef6\u3002<\/p>\n<p>&#8211;exclude=&lt;\u76ee\u5f55\u6216\u6587\u4ef6&gt;     \u7565\u8fc7\u6307\u5b9a\u7684\u76ee\u5f55\u6216\u6587\u4ef6\u3002<\/p>\n<p>-D\u6216&#8211;dereference-args  \u663e\u793a\u6307\u5b9a\u7b26\u53f7\u94fe\u63a5\u7684\u6e90\u6587\u4ef6\u5927\u5c0f\u3002<\/p>\n<p>-H\u6216&#8211;si \u4e0e-h\u53c2\u6570\u76f8\u540c\uff0c\u4f46\u662fK\uff0cM\uff0cG\u662f\u4ee51000\u4e3a\u6362\u7b97\u5355\u4f4d\u3002<\/p>\n<p>-l\u6216&#8211;count-links  \u91cd\u590d\u8ba1\u7b97\u786c\u4ef6\u94fe\u63a5\u7684\u6587\u4ef6\u3002<\/p>\n<p>du\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u67e5\u770b\u6307\u5b9a\u6587\u4ef6\u5927\u5c0f<\/h1>\n<p>$du -h filename<\/p>\n<h1>\u5c55\u793a\u8be5\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u5927\u5c0f\uff0c\u5927\u5c0f\u4ee5\u53ef\u8bfb\u65b9\u5f0f\u5c55\u793a<\/h1>\n<p>$du  -h \/<\/p>\n<h1>\u5c55\u793a\u5f53\u524d\u76ee\u5f55\u5927\u5c0f<\/h1>\n<p>$du -sh<\/p>\n<h1>\u5c55\u793a\u5f53\u524d\u76ee\u5f55\u4e0b\u6bcf\u4e2a\u76ee\u5f55\u5927\u5c0f<\/h1>\n<p>$du -sh .\/<\/p>\n<h1>\u663e\u793a\u6240\u6709\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4ee5\u53ef\u8bfb\u65b9\u5f0f\u5c55\u793a<\/h1>\n<p>$du -ah \/<br \/>\ndf<br \/>\ndf\u4ecb\u7ecd<br \/>\nThe df utility displays statistics about the amount of free disk space on the specified filesystem or on the filesystem of which file is a part.  Values are displayed in 512-byte per block counts.  If neither a file or a filesystem operand is specified, statistics for all mounted filesystems are displayed (sub-ject to the -t option below).<\/p>\n<p>df\u5b9e\u7528\u7a0b\u5e8f\u663e\u793a\u6709\u5173\u6307\u5b9a\u6587\u4ef6\u7cfb\u7edf\u6216\u5176\u4e2d\u4e00\u90e8\u5206\u6587\u4ef6\u7684\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u53ef\u7528\u78c1\u76d8\u7a7a\u95f4\u91cf\u7684\u7edf\u8ba1\u4fe1\u606f\u3002 \u503c\u4ee5\u6bcf\u5757\u8ba1\u6570512\u5b57\u8282\u7684\u5f62\u5f0f\u663e\u793a\u3002 \u5982\u679c\u672a\u6307\u5b9a\u6587\u4ef6\u6216\u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c\u6570\uff0c\u5219\u5c06\u663e\u793a\u6240\u6709\u5df2\u6302\u8f7d\u6587\u4ef6\u7cfb\u7edf\u7684\u7edf\u8ba1\u4fe1\u606f\uff08\u53d7\u4e0b\u9762\u7684-t\u9009\u9879\u7ea6\u675f\uff09\u3002<\/p>\n<p>df\u53c2\u6570\u683c\u5f0f<br \/>\ndf [-b | -h | -H | -k | -m | -g | -P] [-ailn] [-t] [-T type] [file | filesystem &#8230;]<\/p>\n<p>df\u547d\u4ee4\u53c2\u6570<br \/>\n-a \u5168\u90e8\u6587\u4ef6\u7cfb\u7edf\u5217\u8868<\/p>\n<p>-h \u65b9\u4fbf\u9605\u8bfb\u65b9\u5f0f\u663e\u793a<\/p>\n<p>-H \u7b49\u4e8e\u201c-h\u201d\uff0c\u4f46\u662f\u8ba1\u7b97\u5f0f\uff0c1K=1000\uff0c\u800c\u4e0d\u662f1K=1024<\/p>\n<p>-i \u663e\u793ainode\u4fe1\u606f<\/p>\n<p>-k \u533a\u5757\u4e3a1024\u5b57\u8282<\/p>\n<p>-l \u53ea\u663e\u793a\u672c\u5730\u6587\u4ef6\u7cfb\u7edf<\/p>\n<p>-m \u533a\u5757\u4e3a1048576\u5b57\u8282<\/p>\n<p>&#8211;no-sync \u5ffd\u7565 sync \u547d\u4ee4<\/p>\n<p>-P \u8f93\u51fa\u683c\u5f0f\u4e3aPOSIX<\/p>\n<p>&#8211;sync \u5728\u53d6\u5f97\u78c1\u76d8\u4fe1\u606f\u524d\uff0c\u5148\u6267\u884csync\u547d\u4ee4<\/p>\n<p>-T \u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b<\/p>\n<p>&#8211;block-size=&lt;\u533a\u5757\u5927\u5c0f&gt; \u6307\u5b9a\u533a\u5757\u5927\u5c0f<\/p>\n<p>-t&lt;\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&gt; \u53ea\u663e\u793a\u9009\u5b9a\u6587\u4ef6\u7cfb\u7edf\u7684\u78c1\u76d8\u4fe1\u606f<\/p>\n<p>-x&lt;\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&gt; \u4e0d\u663e\u793a\u9009\u5b9a\u6587\u4ef6\u7cfb\u7edf\u7684\u78c1\u76d8\u4fe1\u606f<\/p>\n<p>df\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u5c55\u793a\u5f53\u524d\u7cfb\u7edf\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5\uff0c\u4ee5\u53ef\u8bfb\u7684\u65b9\u5f0f\u5c55\u793a<\/h1>\n<p>$ df -h<br \/>\nFilesystem      Size   Used  Avail Capacity iused               ifree %iused  Mounted on<br \/>\n\/dev\/disk1s1   234Gi   78Gi  151Gi    35% 1376436 9223372036853399371    0%   \/<br \/>\ndevfs          208Ki  208Ki    0Bi   100%     720                   0  100%   \/dev<br \/>\n\/dev\/disk1s4   234Gi  4.0Gi  151Gi     3%       4 9223372036854775803    0%   \/private\/var\/vm<br \/>\nmap -hosts       0Bi    0Bi    0Bi   100%       0                   0  100%   \/net<br \/>\nmap auto_home    0Bi    0Bi    0Bi   100%       0                   0  100%   \/home<br \/>\n\/dev\/disk3s1   290Mi  271Mi   17Mi    94%    2156 9223372036854773651    0%   \/Volumes\/Sourcetrail_2019_4_102<br \/>\nlsof<br \/>\nlsof\u4ecb\u7ecd<br \/>\nlsof\uff08list open files\uff09\u662f\u4e00\u4e2a\u5217\u51fa\u5f53\u524d\u7cfb\u7edf\u6253\u5f00\u6587\u4ef6\u7684\u5de5\u5177\u3002(\u5728linux\u73af\u5883\u4e0b\uff0c\u4efb\u4f55\u4e8b\u7269\u90fd\u4ee5\u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u5728)<\/p>\n<p>lsof\u53ef\u4ee5\u6253\u5f00\u7684\u6587\u4ef6\u5305\u62ec\uff1a<\/p>\n<p>1.\u666e\u901a\u6587\u4ef6<\/p>\n<p>2.\u76ee\u5f55<\/p>\n<p>3.\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\u7684\u6587\u4ef6<\/p>\n<p>4.\u5b57\u7b26\u6216\u8bbe\u5907\u6587\u4ef6<\/p>\n<p>5.(\u51fd\u6570)\u5171\u4eab\u5e93<\/p>\n<p>6.\u7ba1\u9053\uff0c\u547d\u540d\u7ba1\u9053<\/p>\n<p>7.\u7b26\u53f7\u94fe\u63a5<\/p>\n<p>8.\u7f51\u7edc\u6587\u4ef6\uff08\u4f8b\u5982\uff1aNFS file\u3001\u7f51\u7edcsocket\uff0cunix\u57df\u540dsocket\uff09<\/p>\n<p>9.\u8fd8\u6709\u5176\u5b83\u7c7b\u578b\u7684\u6587\u4ef6\uff0c\u7b49\u7b49<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u5728\u6211\u65e5\u5e38\u5de5\u4f5c\u4e2d\u4f7f\u7528\u573a\u666f\u5f88\u591a\uff0c\u4f7f\u7528\u8303\u56f4\u5f88\u5e7f\u3002<\/p>\n<p>lsof\u53c2\u6570\u683c\u5f0f<br \/>\nlsof [ -?abChKlnNOPRtUvVX ] [ -A A ] [ -c c ] [ +c c ] [ +|-d d ] [ +|-D D ] [ +|-e s ] [ +|-E ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [ +|-L [l] ] [ +|-m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t[m<fmt>]] ] [ -s [p:s] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -x [fl] ] [ -z [z] ] [ -Z [Z] ] [ &#8212; ] [names]<\/p>\n<p>lsof\u547d\u4ee4\u53c2\u6570<br \/>\n-a \u5217\u51fa\u6253\u5f00\u6587\u4ef6\u5b58\u5728\u7684\u8fdb\u7a0b<\/p>\n<p>-c&lt;\u8fdb\u7a0b\u540d&gt; \u5217\u51fa\u6307\u5b9a\u8fdb\u7a0b\u6240\u6253\u5f00\u7684\u6587\u4ef6<\/p>\n<p>-g \u5217\u51faGID\u53f7\u8fdb\u7a0b\u8be6\u60c5<\/p>\n<p>-d&lt;\u6587\u4ef6\u53f7&gt; \u5217\u51fa\u5360\u7528\u8be5\u6587\u4ef6\u53f7\u7684\u8fdb\u7a0b<\/p>\n<p>+d&lt;\u76ee\u5f55&gt; \u5217\u51fa\u76ee\u5f55\u4e0b\u88ab\u6253\u5f00\u7684\u6587\u4ef6<\/p>\n<p>+D&lt;\u76ee\u5f55&gt; \u9012\u5f52\u5217\u51fa\u76ee\u5f55\u4e0b\u88ab\u6253\u5f00\u7684\u6587\u4ef6<\/p>\n<p>-n&lt;\u76ee\u5f55&gt; \u5217\u51fa\u4f7f\u7528NFS\u7684\u6587\u4ef6<\/p>\n<p>-i&lt;\u6761\u4ef6&gt; \u5217\u51fa\u7b26\u5408\u6761\u4ef6\u7684\u8fdb\u7a0b\u3002\uff084\u30016\u3001\u534f\u8bae\u3001:\u7aef\u53e3\u3001 @ip \uff09<\/p>\n<p>-p&lt;\u8fdb\u7a0b\u53f7&gt; \u5217\u51fa\u6307\u5b9a\u8fdb\u7a0b\u53f7\u6240\u6253\u5f00\u7684\u6587\u4ef6<\/p>\n<p>-u \u5217\u51faUID\u53f7\u8fdb\u7a0b\u8be6\u60c5<\/p>\n<p>lsof\u5e38\u7528\u53c2\u6570\u793a\u4f8b<br \/>\nlsof\u8f93\u51fa\u5404\u5217\u4fe1\u606f\u7684\u610f\u4e49\u5982\u4e0b\uff1a<\/p>\n<p>COMMAND\uff1a\u8fdb\u7a0b\u7684\u540d\u79f0<\/p>\n<p>PID\uff1a\u8fdb\u7a0b\u6807\u8bc6\u7b26<\/p>\n<p>PPID\uff1a\u7236\u8fdb\u7a0b\u6807\u8bc6\u7b26\uff08\u9700\u8981\u6307\u5b9a-R\u53c2\u6570\uff09<\/p>\n<p>USER\uff1a\u8fdb\u7a0b\u6240\u6709\u8005<\/p>\n<p>PGID\uff1a\u8fdb\u7a0b\u6240\u5c5e\u7ec4<\/p>\n<p>FD\uff1a\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7\u6587\u4ef6\u63cf\u8ff0\u7b26\u8bc6\u522b\u8be5\u6587\u4ef6\u3002\u5982cwd\u3001txt\u7b49<\/p>\n<h1>\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u6253\u5f00\u7684\u6587\u4ef6<\/h1>\n<p>$lsof  <\/p>\n<h1>\u67e5\u770b\u67d0\u4e2a\u6587\u4ef6\u7684\u76f8\u5173\u8fdb\u7a0b  lsof \u6587\u4ef6\u540d<\/h1>\n<p>$ lsof \/bin\/bash<br \/>\nCOMMAND  PID  USER  FD   TYPE DEVICE SIZE\/OFF   NODE NAME<br \/>\nbash    9430 midou txt    REG  253,1   960392 140072 \/usr\/bin\/bash<\/p>\n<h1>\u67e5\u770b\u67d0\u4e2a\u7528\u6237\u6253\u5f00\u7684\u6587\u4ef6\u4fe1\u606f<\/h1>\n<p>$lsof -u username<\/p>\n<h1>\u5217\u51fa\u67d0\u4e2a\u7a0b\u5e8f\u8fdb\u7a0b\u6240\u6253\u5f00\u7684\u6587\u4ef6\u4fe1\u606f<\/h1>\n<p>$lsof -c java<\/p>\n<h1>\u5217\u51fa\u9664\u4e86\u67d0\u4e2a\u7528\u6237\u5916\u7684\u88ab\u6253\u5f00\u7684\u6587\u4ef6\u4fe1\u606f<\/h1>\n<p>$lsof -u ^midou<\/p>\n<h1>\u901a\u8fc7\u67d0\u4e2a\u8fdb\u7a0b\u53f7\u663e\u793a\u8be5\u8fdb\u884c\u6253\u5f00\u7684\u6587\u4ef6<\/h1>\n<p>$lsof -p pid<\/p>\n<h1>\u5217\u51fa\u9664\u4e86\u67d0\u4e2a\u8fdb\u7a0b\u53f7\uff0c\u5176\u4ed6\u8fdb\u7a0b\u53f7\u6240\u6253\u5f00\u7684\u6587\u4ef6\u4fe1\u606f<\/h1>\n<p>$lsof -p ^pid<\/p>\n<h1>\u5217\u51fa\u6240\u6709\u7684\u7f51\u7edc\u8fde\u63a5<\/h1>\n<p>$lsof -i<\/p>\n<h1>\u5217\u51fa\u6240\u6709tcp \u7f51\u7edc\u8fde\u63a5\u4fe1\u606f<\/h1>\n<p>$lsof -i tcp<\/p>\n<h1>\u5217\u51fa\u6240\u6709udp\u7f51\u7edc\u8fde\u63a5\u4fe1\u606f<\/h1>\n<p>$lsof -i udp<\/p>\n<h1>\u5217\u51fa\u8c01\u5728\u67d0\u4e2a\u7aef\u53e3\u4f7f\u7528\u60c5\u51b5<\/h1>\n<p>$lsof -i :port<\/p>\n<h1>\u7279\u5b9a\u7684tcp\u7aef\u53e3<\/h1>\n<p>$lsof -i tcp:port <\/p>\n<h1>\u7279\u5b9a\u7684udp\u7aef\u53e3<\/h1>\n<p>$lsof -i udp:port<\/p>\n<h1>\u5217\u51fa\u67d0\u4e2a\u7528\u6237\u7684\u6240\u6709\u6d3b\u8dc3\u7684\u7f51\u7edc\u7aef\u53e3<\/h1>\n<p>$lsof -a -u username -i<\/p>\n<h1>\u6839\u636e\u6587\u4ef6\u63cf\u8ff0\u7b26\u8303\u56f4\u5217\u51fa\u6587\u4ef6\u4fe1\u606f<\/h1>\n<p>$lsof -d 0-2<br \/>\nping<br \/>\nping\u4ecb\u7ecd<br \/>\nsend ICMP ECHO_REQUEST packets to network hosts<\/p>\n<p>\u5c06ICMP ECHO_REQUEST\u6570\u636e\u5305\u53d1\u9001\u5230\u7f51\u7edc\u4e3b\u673a<\/p>\n<p>ping\u53c2\u6570\u683c\u5f0f<br \/>\nping [-AaCDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize] [-g sweepminsize] [-h sweepincrsize] [-i wait] [-k trafficclass] [-K netservicetype][-l preload] [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr] [-s packetsize] [-t timeout] [-W waittime] [-z tos] [&#8211;apple-connect][&#8211;apple-time] host<br \/>\nping\u547d\u4ee4\u53c2\u6570<br \/>\n-d \u4f7f\u7528Socket\u7684SO_DEBUG\u529f\u80fd\u3002<\/p>\n<p>-f \u6781\u9650\u68c0\u6d4b\u3002\u5927\u91cf\u4e14\u5feb\u901f\u5730\u9001\u7f51\u7edc\u5c01\u5305\u7ed9\u4e00\u53f0\u673a\u5668\uff0c\u770b\u5b83\u7684\u56de\u5e94\u3002<\/p>\n<p>-n \u53ea\u8f93\u51fa\u6570\u503c\u3002<\/p>\n<p>-q \u4e0d\u663e\u793a\u4efb\u4f55\u4f20\u9001\u5c01\u5305\u7684\u4fe1\u606f\uff0c\u53ea\u663e\u793a\u6700\u540e\u7684\u7ed3\u679c\u3002<\/p>\n<p>-r \u5ffd\u7565\u666e\u901a\u7684Routing Table\uff0c\u76f4\u63a5\u5c06\u6570\u636e\u5305\u9001\u5230\u8fdc\u7aef\u4e3b\u673a\u4e0a\u3002\u901a\u5e38\u662f\u67e5\u770b\u672c\u673a\u7684\u7f51\u7edc\u63a5\u53e3\u662f\u5426\u6709\u95ee\u9898\u3002<\/p>\n<p>-R \u8bb0\u5f55\u8def\u7531\u8fc7\u7a0b\u3002<\/p>\n<p>-v \u8be6\u7ec6\u663e\u793a\u6307\u4ee4\u7684\u6267\u884c\u8fc7\u7a0b\u3002<\/p>\n<p>-c \u6570\u76ee\uff1a\u5728\u53d1\u9001\u6307\u5b9a\u6570\u76ee\u7684\u5305\u540e\u505c\u6b62\u3002<\/p>\n<p>-i \u79d2\u6570\uff1a\u8bbe\u5b9a\u95f4\u9694\u51e0\u79d2\u9001\u4e00\u4e2a\u7f51\u7edc\u5c01\u5305\u7ed9\u4e00\u53f0\u673a\u5668\uff0c\u9884\u8bbe\u503c\u662f\u4e00\u79d2\u9001\u4e00\u6b21\u3002<\/p>\n<p>-I \u7f51\u7edc\u754c\u9762\uff1a\u4f7f\u7528\u6307\u5b9a\u7684\u7f51\u7edc\u754c\u9762\u9001\u51fa\u6570\u636e\u5305\u3002<\/p>\n<p>-l \u524d\u7f6e\u8f7d\u5165\uff1a\u8bbe\u7f6e\u5728\u9001\u51fa\u8981\u6c42\u4fe1\u606f\u4e4b\u524d\uff0c\u5148\u884c\u53d1\u51fa\u7684\u6570\u636e\u5305\u3002<\/p>\n<p>-p \u8303\u672c\u6837\u5f0f\uff1a\u8bbe\u7f6e\u586b\u6ee1\u6570\u636e\u5305\u7684\u8303\u672c\u6837\u5f0f\u3002<\/p>\n<p>-s \u5b57\u8282\u6570\uff1a\u6307\u5b9a\u53d1\u9001\u7684\u6570\u636e\u5b57\u8282\u6570\uff0c\u9884\u8bbe\u503c\u662f56\uff0c\u52a0\u4e0a8\u5b57\u8282\u7684ICMP\u5934\uff0c\u4e00\u5171\u662f64ICMP\u6570\u636e\u5b57\u8282\u3002<\/p>\n<p>-t \u5b58\u6d3b\u6570\u503c\uff1a\u8bbe\u7f6e\u5b58\u6d3b\u6570\u503cTTL\u7684\u5927\u5c0f\u3002<\/p>\n<p>ping\uff0c\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u90fd\u662f\u7b80\u5355\u7684\u7528\u6765\u6d4b\u8bd5\u672c\u673a\u4e0e\u5176\u4ed6\u673a\u5668\u4e4b\u95f4\u7684\u7f51\u7edc\u901a\u4fe1\uff0c\u5f53\u7136\u5982\u679c\u4e86\u89e3\u8fd9\u4e9b\u53c2\u6570\u7684\u8bdd\uff0c\u4f1a\u6709\u66f4\u591a\u7684\u7528\u6cd5\u3002<\/p>\n<p>ping\u547d\u4ee4\u53c2\u6570<\/p>\n<h1>\u68c0\u6d4b\u7f51\u7edc\u60c5\u51b5<\/h1>\n<p>$ping host<\/p>\n<h1>ping\u7f51\u5173<\/h1>\n<p>$ping -b host<\/p>\n<h1>ping\u6307\u5b9a\u6b21\u6570<\/h1>\n<p>$ping -c 10 host<\/p>\n<h1>ping\u6307\u5b9a\u65f6\u95f4\u95f4\u9694\u548c\u6b21\u6570\u9650\u5236<\/h1>\n<p>$ping -c 10 -i 0.5 host<\/p>\n<h1>\u901a\u8fc7\u57df\u540dping\u516c\u7f51\u4e0a\u7684\u7ad9\u70b9<\/h1>\n<p>netstat<br \/>\nnetstat\u4ecb\u7ecd<br \/>\nThe netstat command symbolically displays the contents of various network-related data structures.  There are a number of output formats, depending on the options for the information presented.  The first form of the command displays a list of active sockets for each protocol.  The second form presents the contents of one of the other network data structures according to the option selected. Using the third form, with a wait interval specified, netstat will continuously display the information regarding packet traffic on the configured network interfaces.  The fourth form displays statistics for the specified protocol or address family. If a wait interval is specified, the protocol information over the last interval seconds will be displayed.  The fifth form displays per-interface statistics for the specified protocol or address family.  The sixth form displays mbuf(9) statistics.  The seventh form displays routing table for the speci-fied address family.  The eighth form displays routing statistics.<\/p>\n<p>netstat\u547d\u4ee4\u4ee5\u7b26\u53f7\u5f62\u5f0f\u663e\u793a\u5404\u79cd\u4e0e\u7f51\u7edc\u76f8\u5173\u7684\u6570\u636e\u7ed3\u6784\u7684\u5185\u5bb9\u3002\u6709\u591a\u79cd\u8f93\u51fa\u683c\u5f0f\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u663e\u793a\u4fe1\u606f\u7684\u9009\u9879\u3002\u8be5\u547d\u4ee4\u7684\u7b2c\u4e00\u79cd\u5f62\u5f0f\u663e\u793a\u6bcf\u4e2a\u534f\u8bae\u7684\u6d3b\u52a8\u5957\u63a5\u5b57\u5217\u8868\u3002\u7b2c\u4e8c\u79cd\u5f62\u5f0f\u6839\u636e\u9009\u62e9\u7684\u9009\u9879\u663e\u793a\u5176\u4ed6\u7f51\u7edc\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\u7684\u5185\u5bb9\u3002\u4f7f\u7528\u7b2c\u4e09\u79cd\u5f62\u5f0f\uff0c\u5e76\u6307\u5b9a\u7b49\u5f85\u95f4\u9694\uff0cnetstat\u5c06\u5728\u914d\u7f6e\u7684\u7f51\u7edc\u63a5\u53e3\u4e0a\u8fde\u7eed\u663e\u793a\u6709\u5173\u6570\u636e\u5305\u6d41\u91cf\u7684\u4fe1\u606f\u3002\u7b2c\u56db\u79cd\u5f62\u5f0f\u663e\u793a\u6307\u5b9a\u534f\u8bae\u6216\u5730\u5740\u65cf\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u5982\u679c\u6307\u5b9a\u4e86\u7b49\u5f85\u95f4\u9694\uff0c\u5c06\u663e\u793a\u6700\u8fd1\u95f4\u9694\u79d2\u7684\u534f\u8bae\u4fe1\u606f\u3002\u7b2c\u4e94\u79cd\u5f62\u5f0f\u663e\u793a\u6307\u5b9a\u534f\u8bae\u6216\u5730\u5740\u65cf\u7684\u6bcf\u4e2a\u63a5\u53e3\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u7b2c\u516d\u79cd\u5f62\u5f0f\u663e\u793ambuf\uff089\uff09\u7edf\u8ba1\u4fe1\u606f\u3002\u7b2c\u4e03\u79cd\u5f62\u5f0f\u663e\u793a\u6307\u5b9a\u5730\u5740\u7cfb\u5217\u7684\u8def\u7531\u8868\u3002\u7b2c\u516b\u79cd\u5f62\u5f0f\u663e\u793a\u8def\u7531\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<p>netstat\u53c2\u6570\u683c\u5f0f<br \/>\nnetstat [-AaLlnW] [-f address_family | -p protocol]<br \/>\nnetstat [-gilns] [-v] [-f address_family] [-I interface]<br \/>\nnetstat -i | -I interface [-w wait] [-c queue] [-abdgqRtS]<br \/>\nnetstat -s [-s] [-f address_family | -p protocol] [-w wait]<br \/>\nnetstat -i | -I interface -s [-f address_family | -p protocol]<br \/>\nnetstat -m [-m]<br \/>\nnetstat -r [-Aaln] [-f address_family]<br \/>\nnetstat -rs [-s]<br \/>\nnetstat\u547d\u4ee4\u53c2\u6570<br \/>\n-a\u6216\u2013all \u663e\u793a\u6240\u6709\u8fde\u7ebf\u4e2d\u7684Socket\u3002<\/p>\n<p>-A&lt;\u7f51\u7edc\u7c7b\u578b&gt;\u6216\u2013&lt;\u7f51\u7edc\u7c7b\u578b&gt; \u5217\u51fa\u8be5\u7f51\u7edc\u7c7b\u578b\u8fde\u7ebf\u4e2d\u7684\u76f8\u5173\u5730\u5740\u3002<\/p>\n<p>-c\u6216\u2013continuous \u6301\u7eed\u5217\u51fa\u7f51\u7edc\u72b6\u6001\u3002<\/p>\n<p>-C\u6216\u2013cache \u663e\u793a\u8def\u7531\u5668\u914d\u7f6e\u7684\u5feb\u53d6\u4fe1\u606f\u3002<\/p>\n<p>-e\u6216\u2013extend \u663e\u793a\u7f51\u7edc\u5176\u4ed6\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<p>-F\u6216\u2013fib \u663e\u793aFIB\u3002<\/p>\n<p>-g\u6216\u2013groups \u663e\u793a\u591a\u91cd\u5e7f\u64ad\u529f\u80fd\u7fa4\u7ec4\u7ec4\u5458\u540d\u5355\u3002<\/p>\n<p>-h\u6216\u2013help \u5728\u7ebf\u5e2e\u52a9\u3002<\/p>\n<p>-i\u6216\u2013interfaces \u663e\u793a\u7f51\u7edc\u754c\u9762\u4fe1\u606f\u8868\u5355\u3002<\/p>\n<p>-l\u6216\u2013listening \u663e\u793a\u76d1\u63a7\u4e2d\u7684\u670d\u52a1\u5668\u7684Socket\u3002<\/p>\n<p>-M\u6216\u2013masquerade \u663e\u793a\u4f2a\u88c5\u7684\u7f51\u7edc\u8fde\u7ebf\u3002<\/p>\n<p>-n\u6216\u2013numeric \u76f4\u63a5\u4f7f\u7528IP\u5730\u5740\uff0c\u800c\u4e0d\u901a\u8fc7\u57df\u540d\u670d\u52a1\u5668\u3002<\/p>\n<p>-N\u6216\u2013netlink\u6216\u2013symbolic \u663e\u793a\u7f51\u7edc\u786c\u4ef6\u5916\u56f4\u8bbe\u5907\u7684\u7b26\u53f7\u8fde\u63a5\u540d\u79f0\u3002<\/p>\n<p>-o\u6216\u2013timers \u663e\u793a\u8ba1\u65f6\u5668\u3002<\/p>\n<p>-p\u6216\u2013programs \u663e\u793a\u6b63\u5728\u4f7f\u7528Socket\u7684\u7a0b\u5e8f\u8bc6\u522b\u7801\u548c\u7a0b\u5e8f\u540d\u79f0\u3002<\/p>\n<p>-r\u6216\u2013route \u663e\u793aRouting Table\u3002<\/p>\n<p>-s\u6216\u2013statistice \u663e\u793a\u7f51\u7edc\u5de5\u4f5c\u4fe1\u606f\u7edf\u8ba1\u8868\u3002<\/p>\n<p>-t\u6216\u2013tcp \u663e\u793aTCP\u4f20\u8f93\u534f\u8bae\u7684\u8fde\u7ebf\u72b6\u51b5\u3002<\/p>\n<p>-u\u6216\u2013udp \u663e\u793aUDP\u4f20\u8f93\u534f\u8bae\u7684\u8fde\u7ebf\u72b6\u51b5\u3002<\/p>\n<p>-v\u6216\u2013verbose \u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b\u3002<\/p>\n<p>-V\u6216\u2013version \u663e\u793a\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<p>-w\u6216\u2013raw \u663e\u793aRAW\u4f20\u8f93\u534f\u8bae\u7684\u8fde\u7ebf\u72b6\u51b5\u3002<\/p>\n<p>-x\u6216\u2013unix \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a\u201d-A unix\u201d\u53c2\u6570\u76f8\u540c\u3002<\/p>\n<p>\u2013ip\u6216\u2013inet \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a\u201d-A inet\u201d\u53c2\u6570\u76f8\u540c\u3002<\/p>\n<p>netstat\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u5217\u51fa\u6240\u6709\u7aef\u53e3\u4f7f\u7528\u60c5\u51b5<\/h1>\n<p>$netstat -a<\/p>\n<h1>\u663e\u793a\u5f53\u524dUDP\u8fde\u63a5\u72b6\u51b5<\/h1>\n<p>$netstat -nu<\/p>\n<h1>\u663e\u793aUDP\u7aef\u53e3\u53f7\u7684\u4f7f\u7528\u60c5\u51b5<\/h1>\n<p>$netstat -apu<\/p>\n<h1>\u663e\u793a\u7f51\u5361\u5217\u8868<\/h1>\n<p>$netstat -i<\/p>\n<h1>\u663e\u793a\u7f51\u7edc\u7edf\u8ba1\u4fe1\u606f<\/h1>\n<p>$netstat -s<\/p>\n<h1>\u663e\u793a\u76d1\u542c\u7684\u5957\u63a5\u53e3<\/h1>\n<p>$netstat -l<\/p>\n<h1>\u663e\u793a\u6240\u6709\u5df2\u5efa\u7acb\u7684\u6709\u6548\u8fde\u63a5<\/h1>\n<p>$netstat -n<\/p>\n<h1>\u663e\u793a\u5173\u4e8e\u8def\u7531\u8868\u7684\u4fe1\u606f<\/h1>\n<p>$netstat -r<\/p>\n<h1>\u5217\u51fa\u6240\u6709 tcp \u7aef\u53e3<\/h1>\n<p>$netstat -at<\/p>\n<h1>\u627e\u51fa\u7a0b\u5e8f\u8fd0\u884c\u7684\u7aef\u53e3<\/h1>\n<p>$netstat -ap | grep ssh<\/p>\n<h1>\u5728 netstat \u8f93\u51fa\u4e2d\u663e\u793a PID \u548c\u8fdb\u7a0b\u540d\u79f0<\/h1>\n<p>$netstat -pt<br \/>\nifconfig<br \/>\nifconfig\u4ecb\u7ecd<br \/>\nIfconfig is used to configure the kernel-resident network interfaces.  It is used at boot time to set up interfaces as necessary.  After that, it is usually only needed when debugging or when system tuning is needed.<\/p>\n<p>Ifconfig\u7528\u4e8e\u914d\u7f6e\u5185\u6838\u9a7b\u7559\u7684\u7f51\u7edc\u63a5\u53e3\u3002 \u5b83\u5728\u5f15\u5bfc\u65f6\u7528\u4e8e\u6839\u636e\u9700\u8981\u8bbe\u7f6e\u63a5\u53e3\u3002 \u4e4b\u540e\uff0c\u901a\u5e38\u4ec5\u5728\u8c03\u8bd5\u6216\u9700\u8981\u7cfb\u7edf\u8c03\u6574\u65f6\u624d\u9700\u8981\u5b83\u3002<\/p>\n<p>ifconfig\u53c2\u6570\u683c\u5f0f<br \/>\nifconfig [-v] [-a] [-s] [interface]<br \/>\nifconfig [-v] interface [aftype] options | address &#8230;<br \/>\nifconfig\u547d\u4ee4\u53c2\u6570<br \/>\nup \u542f\u52a8\u6307\u5b9a\u7f51\u7edc\u8bbe\u5907\/\u7f51\u5361\u3002<\/p>\n<p>down \u5173\u95ed\u6307\u5b9a\u7f51\u7edc\u8bbe\u5907\/\u7f51\u5361\u3002\u8be5\u53c2\u6570\u53ef\u4ee5\u6709\u6548\u5730\u963b\u6b62\u901a\u8fc7\u6307\u5b9a\u63a5\u53e3\u7684IP\u4fe1\u606f\u6d41\uff0c\u5982\u679c\u60f3\u6c38\u4e45\u5730\u5173\u95ed\u4e00\u4e2a\u63a5\u53e3\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u4ece\u6838\u5fc3\u8def\u7531\u8868\u4e2d\u5c06\u8be5\u63a5\u53e3\u7684\u8def\u7531\u4fe1\u606f\u5168\u90e8\u5220\u9664\u3002<\/p>\n<p>arp \u8bbe\u7f6e\u6307\u5b9a\u7f51\u5361\u662f\u5426\u652f\u6301ARP\u534f\u8bae\u3002<\/p>\n<p>-promisc \u8bbe\u7f6e\u662f\u5426\u652f\u6301\u7f51\u5361\u7684promiscuous\u6a21\u5f0f\uff0c\u5982\u679c\u9009\u62e9\u6b64\u53c2\u6570\uff0c\u7f51\u5361\u5c06\u63a5\u6536\u7f51\u7edc\u4e2d\u53d1\u7ed9\u5b83\u6240\u6709\u7684\u6570\u636e\u5305<\/p>\n<p>-allmulti \u8bbe\u7f6e\u662f\u5426\u652f\u6301\u591a\u64ad\u6a21\u5f0f\uff0c\u5982\u679c\u9009\u62e9\u6b64\u53c2\u6570\uff0c\u7f51\u5361\u5c06\u63a5\u6536\u7f51\u7edc\u4e2d\u6240\u6709\u7684\u591a\u64ad\u6570\u636e\u5305<\/p>\n<p>-a \u663e\u793a\u5168\u90e8\u63a5\u53e3\u4fe1\u606f<\/p>\n<p>-s \u663e\u793a\u6458\u8981\u4fe1\u606f\uff08\u7c7b\u4f3c\u4e8e netstat -i\uff09<\/p>\n<p>add \u7ed9\u6307\u5b9a\u7f51\u5361\u914d\u7f6eIPv6\u5730\u5740<\/p>\n<p>del \u5220\u9664\u6307\u5b9a\u7f51\u5361\u7684IPv6\u5730\u5740<\/p>\n<p>&lt;\u786c\u4ef6\u5730\u5740&gt; \u914d\u7f6e\u7f51\u5361\u6700\u5927\u7684\u4f20\u8f93\u5355\u5143<\/p>\n<p>mtu&lt;\u5b57\u8282\u6570&gt; \u8bbe\u7f6e\u7f51\u5361\u7684\u6700\u5927\u4f20\u8f93\u5355\u5143 (bytes)<\/p>\n<p>netmask&lt;\u5b50\u7f51\u63a9\u7801&gt; \u8bbe\u7f6e\u7f51\u5361\u7684\u5b50\u7f51\u63a9\u7801\u3002\u63a9\u7801\u53ef\u4ee5\u662f\u6709\u524d\u7f000x\u768432\u4f4d\u5341\u516d\u8fdb\u5236\u6570\uff0c\u4e5f\u53ef\u4ee5\u662f\u7528\u70b9\u5206\u5f00\u76844\u4e2a\u5341\u8fdb\u5236\u6570\u3002\u5982\u679c\u4e0d\u6253\u7b97\u5c06\u7f51\u7edc\u5206\u6210\u5b50\u7f51\uff0c\u53ef\u4ee5\u4e0d\u7ba1\u8fd9\u4e00\u9009\u9879\uff1b\u5982\u679c\u8981\u4f7f\u7528\u5b50\u7f51\uff0c\u90a3\u4e48\u8bf7\u8bb0\u4f4f\uff0c\u7f51\u7edc\u4e2d\u6bcf\u4e00\u4e2a\u7cfb\u7edf\u5fc5\u987b\u6709\u76f8\u540c\u5b50\u7f51\u63a9\u7801\u3002<\/p>\n<p>tunel \u5efa\u7acb\u96a7\u9053<\/p>\n<p>dstaddr \u8bbe\u5b9a\u4e00\u4e2a\u8fdc\u7aef\u5730\u5740\uff0c\u5efa\u7acb\u70b9\u5bf9\u70b9\u901a\u4fe1<\/p>\n<p>-broadcast&lt;\u5730\u5740&gt; \u4e3a\u6307\u5b9a\u7f51\u5361\u8bbe\u7f6e\u5e7f\u64ad\u534f\u8bae<\/p>\n<p>-pointtopoint&lt;\u5730\u5740&gt; \u4e3a\u7f51\u5361\u8bbe\u7f6e\u70b9\u5bf9\u70b9\u901a\u8baf\u534f\u8bae<\/p>\n<p>multicast \u4e3a\u7f51\u5361\u8bbe\u7f6e\u7ec4\u64ad\u6807\u5fd7<\/p>\n<p>address \u4e3a\u7f51\u5361\u8bbe\u7f6eIPv4\u5730\u5740<\/p>\n<p>txqueuelen&lt;\u957f\u5ea6&gt; \u4e3a\u7f51\u5361\u8bbe\u7f6e\u4f20\u8f93\u5217\u961f\u7684\u957f\u5ea6<\/p>\n<p>ifconfig\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u663e\u793a\u7f51\u7edc\u8bbe\u5907\u4fe1\u606f<\/h1>\n<p>$ifconfig<\/p>\n<h1>\u542f\u52a8\u5173\u95ed\u6307\u5b9a\u7f51\u5361<\/h1>\n<p>$ifconfig eth0 up<br \/>\n$ifconfig eth0 down<\/p>\n<h1>\u914d\u7f6eIP\u5730\u5740<\/h1>\n<p>$ifconfig eth0 ip<\/p>\n<h1>\u542f\u7528\u548c\u5173\u95edARP\u534f\u8bae<\/h1>\n<p>$ifconfig eth0 arp<br \/>\n$ifconfig eth0 -arp<\/p>\n<h1>\u8bbe\u7f6e\u6700\u5927\u4f20\u8f93\u5355\u5143<\/h1>\n<p>$ifconfig eth0 mtu 1500<br \/>\n\u89e3\u91ca<br \/>\neth0 \u8868\u793a\u7b2c\u4e00\u5757\u7f51\u5361\uff0c \u5176\u4e2d HWaddr \u8868\u793a\u7f51\u5361\u7684\u7269\u7406\u5730\u5740<\/p>\n<p>inet addr \u7528\u6765\u8868\u793a\u7f51\u5361\u7684IP\u5730\u5740<\/p>\n<p>lo \u662f\u8868\u793a\u4e3b\u673a\u7684\u56de\u574f\u5730\u5740\uff0c\u8fd9\u4e2a\u4e00\u822c\u662f\u7528\u6765\u6d4b\u8bd5\u4e00\u4e2a\u7f51\u7edc\u7a0b\u5e8f\uff0c\u4f46\u53c8\u4e0d\u60f3\u8ba9\u5c40\u57df\u7f51\u6216\u5916\u7f51\u7684\u7528\u6237\u80fd\u591f\u67e5\u770b\uff0c\u53ea\u80fd\u5728\u6b64\u53f0\u4e3b\u673a\u4e0a\u8fd0\u884c\u548c\u67e5\u770b\u6240\u7528\u7684\u7f51\u7edc\u63a5\u53e3\u3002<\/p>\n<p>\u7b2c\u4e00\u884c\uff1a\u8fde\u63a5\u7c7b\u578b\uff1aEthernet\uff08\u4ee5\u592a\u7f51\uff09HWaddr\uff08\u786c\u4ef6mac\u5730\u5740\uff09<\/p>\n<p>\u7b2c\u4e8c\u884c\uff1a\u7f51\u5361\u7684IP\u5730\u5740\u3001\u5b50\u7f51\u3001\u63a9\u7801<\/p>\n<p>\u7b2c\u4e09\u884c\uff1aUP\uff08\u4ee3\u8868\u7f51\u5361\u5f00\u542f\u72b6\u6001\uff09RUNNING\uff08\u4ee3\u8868\u7f51\u5361\u7684\u7f51\u7ebf\u88ab\u63a5\u4e0a\uff09MULTICAST\uff08\u652f\u6301\u7ec4\u64ad\uff09MTU:1500\uff08\u6700\u5927\u4f20\u8f93\u5355\u5143\uff09\uff1a1500\u5b57\u8282<\/p>\n<p>\u7b2c\u56db\u3001\u4e94\u884c\uff1a\u63a5\u6536\u3001\u53d1\u9001\u6570\u636e\u5305\u60c5\u51b5\u7edf\u8ba1<\/p>\n<p>\u7b2c\u4e03\u884c\uff1a\u63a5\u6536\u3001\u53d1\u9001\u6570\u636e\u5b57\u8282\u6570\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<p>hostname<br \/>\nhostname\u4ecb\u7ecd<br \/>\nHostname is used to display the system&#8217;s DNS name, and to display or set its hostname or NIS domain name.<\/p>\n<p>\u4e3b\u673a\u540d\u7528\u4e8e\u663e\u793a\u7cfb\u7edf\u7684DNS\u540d\u79f0\uff0c\u5e76\u663e\u793a\u6216\u8bbe\u7f6e\u5176\u4e3b\u673a\u540d\u6216NIS\u57df\u540d\u3002<\/p>\n<p>hostname\u53c2\u6570\u683c\u5f0f<br \/>\nhostname [-a|&#8211;alias] [-d|&#8211;domain] [-f|&#8211;fqdn|&#8211;long] [-A|&#8211;all-fqdns] [-i|&#8211;ip-address] [-I|&#8211;all-ip-addresses] [-s|&#8211;short] [-y|&#8211;yp|&#8211;nis]<br \/>\nhostname [-b|&#8211;boot] [-F|&#8211;file filename] [hostname]<br \/>\nhostname [-h|&#8211;help] [-V|&#8211;version]<br \/>\nhostname\u547d\u4ee4\u53c2\u6570<br \/>\n-v\uff1a\u8be6\u7ec6\u4fe1\u606f\u6a21\u5f0f\uff1b<br \/>\n-a\uff1a\u663e\u793a\u4e3b\u673a\u522b\u540d\uff1b<br \/>\n-d\uff1a\u663e\u793aDNS\u57df\u540d\uff1b<br \/>\n-f\uff1a\u663e\u793aFQDN\u540d\u79f0\uff1b<br \/>\n-i\uff1a\u663e\u793a\u4e3b\u673a\u7684ip\u5730\u5740\uff1b<br \/>\n-s\uff1a\u663e\u793a\u77ed\u4e3b\u673a\u540d\u79f0\uff0c\u5728\u7b2c\u4e00\u4e2a\u70b9\u5904\u622a\u65ad\uff1b<br \/>\n-y\uff1a\u663e\u793aNIS\u57df\u540d\u3002<br \/>\nhostname\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u67e5\u770b\u4e3b\u673aip,\u8fd9\u4e2a\u547d\u4ee4\u6211\u6700\u63a8\u8350\u7684\u4e00\u4e2a\u7528\u6cd5\u5c31\u662f\u67e5\u770b\u4e3b\u673aip\uff0c\u4e4b\u524d\u6211\u4e00\u76f4\u7528ifconfig<\/h1>\n<p>$hostname -i<br \/>\ntraceroute<br \/>\ntraceroute\u4ecb\u7ecd<br \/>\ntraceroute  tracks  the  route  packets  taken  from an IP network on their way to a given host. It utilizes the IP protocol&#8217;s time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.<\/p>\n<p>traceroute\u8ddf\u8e2a\u4eceIP\u7f51\u7edc\u83b7\u53d6\u5230\u7ed9\u5b9a\u4e3b\u673a\u7684\u8def\u7531\u4fe1\u606f\u5305\u3002 \u5b83\u5229\u7528IP\u534f\u8bae\u7684\u751f\u5b58\u65f6\u95f4\uff08TTL\uff09\u5b57\u6bb5\u5e76\u5c1d\u8bd5\u4ece\u6bcf\u4e2a\u7f51\u5173\u5230\u4e3b\u673a\u7684\u8def\u5f84\u5f15\u53d1ICMP TIME_EXCEEDED\u54cd\u5e94\u3002<\/p>\n<p>traceroute\u53c2\u6570\u683c\u5f0f<br \/>\ntraceroute [-46dFITUnreAV] [-f first_ttl] [-g gate,&#8230;]<br \/>\n[-i device] [-m max_ttl] [-p port] [-s src_addr]<br \/>\n[-q nqueries] [-N squeries] [-t tos]<br \/>\n[-l flow_label] [-w waittime] [-z sendwait] [-UL] [-D]<br \/>\n[-P proto] [&#8211;sport=port] [-M method] [-O mod_options]<br \/>\n[&#8211;mtu] [&#8211;back]<br \/>\nhost [packet_len]<br \/>\ntraceroute\u547d\u4ee4\u53c2\u6570<br \/>\n-d \u4f7f\u7528Socket\u5c42\u7ea7\u7684\u6392\u9519\u529f\u80fd\u3002<\/p>\n<p>-f \u8bbe\u7f6e\u7b2c\u4e00\u4e2a\u68c0\u6d4b\u6570\u636e\u5305\u7684\u5b58\u6d3b\u6570\u503cTTL\u7684\u5927\u5c0f\u3002<\/p>\n<p>-F \u8bbe\u7f6e\u52ff\u79bb\u65ad\u4f4d\u3002<\/p>\n<p>-g \u8bbe\u7f6e\u6765\u6e90\u8def\u7531\u7f51\u5173\uff0c\u6700\u591a\u53ef\u8bbe\u7f6e8\u4e2a\u3002<\/p>\n<p>-i \u4f7f\u7528\u6307\u5b9a\u7684\u7f51\u7edc\u754c\u9762\u9001\u51fa\u6570\u636e\u5305\u3002<\/p>\n<p>-I \u4f7f\u7528ICMP\u56de\u5e94\u53d6\u4ee3UDP\u8d44\u6599\u4fe1\u606f\u3002<\/p>\n<p>-m \u8bbe\u7f6e\u68c0\u6d4b\u6570\u636e\u5305\u7684\u6700\u5927\u5b58\u6d3b\u6570\u503cTTL\u7684\u5927\u5c0f\u3002<\/p>\n<p>-n \u76f4\u63a5\u4f7f\u7528IP\u5730\u5740\u800c\u975e\u4e3b\u673a\u540d\u79f0\u3002<\/p>\n<p>-p \u8bbe\u7f6eUDP\u4f20\u8f93\u534f\u8bae\u7684\u901a\u4fe1\u7aef\u53e3\u3002<\/p>\n<p>-r \u5ffd\u7565\u666e\u901a\u7684Routing Table\uff0c\u76f4\u63a5\u5c06\u6570\u636e\u5305\u9001\u5230\u8fdc\u7aef\u4e3b\u673a\u4e0a\u3002<\/p>\n<p>-s \u8bbe\u7f6e\u672c\u5730\u4e3b\u673a\u9001\u51fa\u6570\u636e\u5305\u7684IP\u5730\u5740\u3002<\/p>\n<p>-t \u8bbe\u7f6e\u68c0\u6d4b\u6570\u636e\u5305\u7684TOS\u6570\u503c\u3002<\/p>\n<p>-v \u8be6\u7ec6\u663e\u793a\u6307\u4ee4\u7684\u6267\u884c\u8fc7\u7a0b\u3002<\/p>\n<p>-w \u8bbe\u7f6e\u7b49\u5f85\u8fdc\u7aef\u4e3b\u673a\u56de\u62a5\u7684\u65f6\u95f4\u3002<\/p>\n<p>-x \u5f00\u542f\u6216\u5173\u95ed\u6570\u636e\u5305\u7684\u6b63\u786e\u6027\u68c0\u9a8c\u3002<\/p>\n<p>traceroute\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>traceroute \u4e00\u4e0b\u767e\u5ea6\uff0c\u770b\u4e0b\u6570\u636e\u5305\u7684\u8def\u7531\u9014\u5f84<\/h1>\n<p>$ traceroute www.baidu.com<br \/>\ntraceroute: Warning: www.baidu.com has multiple addresses; using 183.232.231.172<br \/>\ntraceroute to www.baidu.com (183.232.231.172), 64 hops max, 52 byte packets<br \/>\n1  192.168.0.1 (192.168.0.1)  6.059 ms  0.879 ms  0.843 ms<br \/>\n2  192.168.1.1 (192.168.1.1)  1.305 ms  2.232 ms  2.167 ms<br \/>\n3  10.104.0.1 (10.104.0.1)  5.085 ms  5.534 ms  4.466 ms<br \/>\n4  221.131.253.13 (221.131.253.13)  4.633 ms  11.736 ms  4.199 ms<br \/>\n5  117.148.181.1 (117.148.181.1)  4.544 ms <em><br \/>\n112.11.233.49 (112.11.233.49)  13.384 ms<br \/>\n6  221.183.47.165 (221.183.47.165)  6.591 ms  6.643 ms<br \/>\n221.183.47.161 (221.183.47.161)  5.591 ms<br \/>\n7  <\/em> 221.183.40.225 (221.183.40.225)  27.242 ms  25.222 ms<br \/>\n8  221.183.59.154 (221.183.59.154)  27.937 ms  27.501 ms  26.869 ms<br \/>\n9  120.241.49.198 (120.241.49.198)  60.772 ms<br \/>\n120.241.49.30 (120.241.49.30)  33.451 ms<br \/>\n120.241.48.190 (120.241.48.190)  45.563 ms<br \/>\n10  <em> <\/em> <em><br \/>\n11  <\/em> <em> <\/em><br \/>\n12  <em> <\/em> <em><br \/>\n13  <\/em> <em> <\/em><br \/>\n14  <em> <\/em> <em><br \/>\n15  <\/em> <em> <\/em><br \/>\n16  <em> <\/em> *<br \/>\n\u89e3\u91ca<br \/>\n\u8bb0\u5f55\u6309\u5e8f\u5217\u53f7\u4ece1\u5f00\u59cb\uff0c\u6bcf\u884c\u7eaa\u5f55\u5c31\u662f\u4e00\u8df3 \uff0c\u6bcf\u8df3\u8868\u793a\u4e00\u4e2a\u7f51\u5173\uff0c\u6211\u4eec\u770b\u5230\u6bcf\u884c\u6709\u4e09\u4e2a\u65f6\u95f4\uff0c\u5355\u4f4d\u662f ms\uff0c\u5176\u5b9e\u5c31\u662f-q\u7684\u9ed8\u8ba4\u53c2\u6570\u3002\u63a2\u6d4b\u6570\u636e\u5305\u5411\u6bcf\u4e2a\u7f51\u5173\u53d1\u9001\u4e09\u4e2a\u6570\u636e\u5305\u540e\uff0c\u7f51\u5173\u54cd\u5e94\u540e\u8fd4\u56de\u7684\u65f6\u95f4\uff1b\u5982\u679c\u60a8\u7528 traceroute -q 10 www.baidu.com\uff0c\u8868\u793a\u5411\u6bcf\u4e2a\u7f51\u5173\u53d1\u900110\u4e2a\u6570\u636e\u5305\u3002<\/p>\n<p>\u6709\u65f6\u6211\u4eectraceroute \u4e00\u53f0\u4e3b\u673a\u65f6\uff0c\u4f1a\u770b\u5230\u6709\u4e00\u4e9b\u884c\u662f\u4ee5\u661f\u53f7\u8868\u793a\u7684\u3002\u51fa\u73b0\u8fd9\u6837\u7684\u60c5\u51b5\uff0c\u53ef\u80fd\u662f\u9632\u706b\u5899\u5c01\u6389\u4e86ICMP\u7684\u8fd4\u56de\u4fe1\u606f\uff0c\u6240\u4ee5\u6211\u4eec\u5f97\u4e0d\u5230\u4ec0\u4e48\u76f8\u5173\u7684\u6570\u636e\u5305\u8fd4\u56de\u6570\u636e\u3002<\/p>\n<p>route<br \/>\nroute\u4ecb\u7ecd<br \/>\nRoute  manipulates the kernel&#8217;s IP routing tables.  Its primary use is to set up static routes to specific hosts or networks via an interface after it has been config\u2010ured with the ifconfig(8) program.<\/p>\n<p>Route\u64cd\u7eb5\u5185\u6838\u7684IP\u8def\u7531\u8868\u3002 \u5b83\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728\u4f7f\u7528ifconfig\uff088\uff09\u7a0b\u5e8f\u5bf9\u5176\u8fdb\u884c\u914d\u7f6e\u540e\uff0c\u901a\u8fc7\u63a5\u53e3\u8bbe\u7f6e\u5230\u7279\u5b9a\u4e3b\u673a\u6216\u7f51\u7edc\u7684\u9759\u6001\u8def\u7531\u3002<\/p>\n<p>route\u53c2\u6570\u683c\u5f0f<br \/>\nroute [-CFvnNee] [-A family |-4|-6]<\/p>\n<p>route  [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]<\/p>\n<p>route  [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]<br \/>\nroute\u547d\u4ee4\u53c2\u6570<br \/>\n-c \u663e\u793a\u66f4\u591a\u4fe1\u606f<\/p>\n<p>-n \u4e0d\u89e3\u6790\u540d\u5b57<\/p>\n<p>-v \u663e\u793a\u8be6\u7ec6\u7684\u5904\u7406\u4fe1\u606f<\/p>\n<p>-F \u663e\u793a\u53d1\u9001\u4fe1\u606f<\/p>\n<p>-C \u663e\u793a\u8def\u7531\u7f13\u5b58<\/p>\n<p>-f \u6e05\u9664\u6240\u6709\u7f51\u5173\u5165\u53e3\u7684\u8def\u7531\u8868\u3002<\/p>\n<p>-p \u4e0e add \u547d\u4ee4\u4e00\u8d77\u4f7f\u7528\u65f6\u4f7f\u8def\u7531\u5177\u6709\u6c38\u4e45\u6027\u3002<\/p>\n<p>add:\u6dfb\u52a0\u4e00\u6761\u65b0\u8def\u7531\u3002<\/p>\n<p>del:\u5220\u9664\u4e00\u6761\u8def\u7531\u3002<\/p>\n<p>-net:\u76ee\u6807\u5730\u5740\u662f\u4e00\u4e2a\u7f51\u7edc\u3002<\/p>\n<p>-host:\u76ee\u6807\u5730\u5740\u662f\u4e00\u4e2a\u4e3b\u673a\u3002<\/p>\n<p>route\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u663e\u793a\u5f53\u524d\u8def\u7531<\/h1>\n<p>$route<\/p>\n<h1>\u5c4f\u853d\u4e00\u6761\u8def\u7531<\/h1>\n<p>$route add -net 224.0.0.0 netmask 240.0.0.0 reject<\/p>\n<h1>\u5220\u9664\u8def\u7531\u8bb0\u5f55<\/h1>\n<p>$route del -net 224.0.0.0 netmask 240.0.0.0<\/p>\n<h1>\u5220\u9664\u548c\u6dfb\u52a0\u8bbe\u7f6e\u9ed8\u8ba4\u7f51\u5173<\/h1>\n<p>$route del default gw 192.168.0.100<br \/>\n$route add default gw 192.168.0.100<br \/>\nwget<br \/>\nwget\u4ecb\u7ecd<br \/>\nGNU Wget is a free utility for non-interactive download of files from the Web.  It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.<\/p>\n<p>GNU Wget\u662f\u4e00\u4e2a\u514d\u8d39\u5b9e\u7528\u7a0b\u5e8f\uff0c\u7528\u4e8e\u4eceWeb\u975e\u4ea4\u4e92\u5f0f\u4e0b\u8f7d\u6587\u4ef6\u3002 \u5b83\u652f\u6301HTTP\uff0cHTTPS\u548cFTP\u534f\u8bae\uff0c\u4ee5\u53ca\u901a\u8fc7HTTP\u4ee3\u7406\u8fdb\u884c\u68c0\u7d22\u3002<\/p>\n<p>wget\u53c2\u6570\u683c\u5f0f<br \/>\nwget [option]&#8230; [URL]&#8230;<\/p>\n<p>wget\u547d\u4ee4\u53c2\u6570<br \/>\n\u542f\u52a8\uff1a<br \/>\n-V,  &#8211;version           \u663e\u793a Wget \u7684\u7248\u672c\u4fe1\u606f\u5e76\u9000\u51fa\u3002<br \/>\n-h,  &#8211;help              \u6253\u5370\u6b64\u5e2e\u52a9\u3002<br \/>\n-b,  &#8211;background        \u542f\u52a8\u540e\u8f6c\u5165\u540e\u53f0\u3002<br \/>\n-e,  &#8211;execute=COMMAND   \u8fd0\u884c\u4e00\u4e2a\u201c.wgetrc\u201d\u98ce\u683c\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u65e5\u5fd7\u548c\u8f93\u5165\u6587\u4ef6\uff1a<br \/>\n-o,  &#8211;output-file=FILE    \u5c06\u65e5\u5fd7\u4fe1\u606f\u5199\u5165 FILE\u3002<br \/>\n-a,  &#8211;append-output=FILE  \u5c06\u4fe1\u606f\u6dfb\u52a0\u81f3 FILE\u3002<br \/>\n-d,  &#8211;debug               \u6253\u5370\u5927\u91cf\u8c03\u8bd5\u4fe1\u606f\u3002<br \/>\n-q,  &#8211;quiet               \u5b89\u9759\u6a21\u5f0f (\u65e0\u4fe1\u606f\u8f93\u51fa)\u3002<br \/>\n-v,  &#8211;verbose             \u8be6\u5c3d\u7684\u8f93\u51fa (\u6b64\u4e3a\u9ed8\u8ba4\u503c)\u3002<br \/>\n-nv, &#8211;no-verbose          \u5173\u95ed\u8be6\u5c3d\u8f93\u51fa\uff0c\u4f46\u4e0d\u8fdb\u5165\u5b89\u9759\u6a21\u5f0f\u3002<br \/>\n-i,  &#8211;input-file=FILE     \u4e0b\u8f7d\u672c\u5730\u6216\u5916\u90e8 FILE \u4e2d\u7684 URLs\u3002<br \/>\n-F,  &#8211;force-html          \u628a\u8f93\u5165\u6587\u4ef6\u5f53\u6210 HTML \u6587\u4ef6\u3002<br \/>\n-B,  &#8211;base=URL            \u89e3\u6790\u4e0e URL \u76f8\u5173\u7684<br \/>\nHTML \u8f93\u5165\u6587\u4ef6 (\u7531 -i -F \u9009\u9879\u6307\u5b9a)\u3002<br \/>\n&#8211;config=FILE         Specify config file to use.<\/p>\n<p>\u4e0b\u8f7d\uff1a<br \/>\n-t,  &#8211;tries=NUMBER            \u8bbe\u7f6e\u91cd\u8bd5\u6b21\u6570\u4e3a NUMBER (0 \u4ee3\u8868\u65e0\u9650\u5236)\u3002<br \/>\n&#8211;retry-connrefused       \u5373\u4f7f\u62d2\u7edd\u8fde\u63a5\u4e5f\u662f\u91cd\u8bd5\u3002<br \/>\n-O,  &#8211;output-document=FILE    \u5c06\u6587\u6863\u5199\u5165 FILE\u3002<br \/>\n-nc, &#8211;no-clobber              skip downloads that would download to<br \/>\nexisting files (overwriting them).<br \/>\n-c,  &#8211;continue                \u65ad\u70b9\u7eed\u4f20\u4e0b\u8f7d\u6587\u4ef6\u3002<br \/>\n&#8211;progress=TYPE           \u9009\u62e9\u8fdb\u5ea6\u6761\u7c7b\u578b\u3002<br \/>\n-N,  &#8211;timestamping            \u53ea\u83b7\u53d6\u6bd4\u672c\u5730\u6587\u4ef6\u65b0\u7684\u6587\u4ef6\u3002<br \/>\n&#8211;no-use-server-timestamps     \u4e0d\u7528\u670d\u52a1\u5668\u4e0a\u7684\u65f6\u95f4\u6233\u6765\u8bbe\u7f6e\u672c\u5730\u6587\u4ef6\u3002<br \/>\n-S,  &#8211;server-response         \u6253\u5370\u670d\u52a1\u5668\u54cd\u5e94\u3002<br \/>\n&#8211;spider                  \u4e0d\u4e0b\u8f7d\u4efb\u4f55\u6587\u4ef6\u3002<br \/>\n-T,  &#8211;timeout=SECONDS         \u5c06\u6240\u6709\u8d85\u65f6\u8bbe\u4e3a SECONDS \u79d2\u3002<br \/>\n&#8211;dns-timeout=SECS        \u8bbe\u7f6e DNS \u67e5\u5bfb\u8d85\u65f6\u4e3a SECS \u79d2\u3002<br \/>\n&#8211;connect-timeout=SECS    \u8bbe\u7f6e\u8fde\u63a5\u8d85\u65f6\u4e3a SECS \u79d2\u3002<br \/>\n&#8211;read-timeout=SECS       \u8bbe\u7f6e\u8bfb\u53d6\u8d85\u65f6\u4e3a SECS \u79d2\u3002<br \/>\n-w,  &#8211;wait=SECONDS            \u7b49\u5f85\u95f4\u9694\u4e3a SECONDS \u79d2\u3002<br \/>\n&#8211;waitretry=SECONDS       \u5728\u83b7\u53d6\u6587\u4ef6\u7684\u91cd\u8bd5\u671f\u95f4\u7b49\u5f85 1..SECONDS \u79d2\u3002<br \/>\n&#8211;random-wait             \u83b7\u53d6\u591a\u4e2a\u6587\u4ef6\u65f6\uff0c\u6bcf\u6b21\u968f\u673a\u7b49\u5f85\u95f4\u9694<br \/>\n0.5<em>WAIT&#8230;1.5<\/em>WAIT \u79d2\u3002<br \/>\n&#8211;no-proxy                \u7981\u6b62\u4f7f\u7528\u4ee3\u7406\u3002<br \/>\n-Q,  &#8211;quota=NUMBER            \u8bbe\u7f6e\u83b7\u53d6\u914d\u989d\u4e3a NUMBER \u5b57\u8282\u3002<br \/>\n&#8211;bind-address=ADDRESS    \u7ed1\u5b9a\u81f3\u672c\u5730\u4e3b\u673a\u4e0a\u7684 ADDRESS (\u4e3b\u673a\u540d\u6216\u662f IP)\u3002<br \/>\n&#8211;limit-rate=RATE         \u9650\u5236\u4e0b\u8f7d\u901f\u7387\u4e3a RATE\u3002<br \/>\n&#8211;no-dns-cache            \u5173\u95ed DNS \u67e5\u5bfb\u7f13\u5b58\u3002<br \/>\n&#8211;restrict-file-names=OS  \u9650\u5b9a\u6587\u4ef6\u540d\u4e2d\u7684\u5b57\u7b26\u4e3a OS \u5141\u8bb8\u7684\u5b57\u7b26\u3002<br \/>\n&#8211;ignore-case             \u5339\u914d\u6587\u4ef6\/\u76ee\u5f55\u65f6\u5ffd\u7565\u5927\u5c0f\u5199\u3002<br \/>\n-4,  &#8211;inet4-only              \u4ec5\u8fde\u63a5\u81f3 IPv4 \u5730\u5740\u3002<br \/>\n-6,  &#8211;inet6-only              \u4ec5\u8fde\u63a5\u81f3 IPv6 \u5730\u5740\u3002<br \/>\n&#8211;prefer-family=FAMILY    \u9996\u5148\u8fde\u63a5\u81f3\u6307\u5b9a\u534f\u8bae\u7684\u5730\u5740<br \/>\nFAMILY \u4e3a IPv6\uff0cIPv4 \u6216\u662f none\u3002<br \/>\n&#8211;user=USER               \u5c06 ftp \u548c http \u7684\u7528\u6237\u540d\u5747\u8bbe\u7f6e\u4e3a USER\u3002<br \/>\n&#8211;password=PASS           \u5c06 ftp \u548c http \u7684\u5bc6\u7801\u5747\u8bbe\u7f6e\u4e3a PASS\u3002<br \/>\n&#8211;ask-password            \u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002<br \/>\n&#8211;no-iri                  \u5173\u95ed IRI \u652f\u6301\u3002<br \/>\n&#8211;local-encoding=ENC      IRI (\u56fd\u9645\u5316\u8d44\u6e90\u6807\u8bc6\u7b26) \u4f7f\u7528 ENC \u4f5c\u4e3a\u672c\u5730\u7f16\u7801\u3002<br \/>\n&#8211;remote-encoding=ENC     \u4f7f\u7528 ENC \u4f5c\u4e3a\u9ed8\u8ba4\u8fdc\u7a0b\u7f16\u7801\u3002<br \/>\n&#8211;unlink                  remove file before clobber.<\/p>\n<p>\u76ee\u5f55\uff1a<br \/>\n-nd, &#8211;no-directories           \u4e0d\u521b\u5efa\u76ee\u5f55\u3002<br \/>\n-x,  &#8211;force-directories        \u5f3a\u5236\u521b\u5efa\u76ee\u5f55\u3002<br \/>\n-nH, &#8211;no-host-directories      \u4e0d\u8981\u521b\u5efa\u4e3b\u76ee\u5f55\u3002<br \/>\n&#8211;protocol-directories     \u5728\u76ee\u5f55\u4e2d\u4f7f\u7528\u534f\u8bae\u540d\u79f0\u3002<br \/>\n-P,  &#8211;directory-prefix=PREFIX  \u4ee5 PREFIX\/&#8230; \u4fdd\u5b58\u6587\u4ef6<br \/>\n&#8211;cut-dirs=NUMBER          \u5ffd\u7565\u8fdc\u7a0b\u76ee\u5f55\u4e2d NUMBER \u4e2a\u76ee\u5f55\u5c42\u3002<\/p>\n<p>HTTP \u9009\u9879\uff1a<br \/>\n&#8211;http-user=USER        \u8bbe\u7f6e http \u7528\u6237\u540d\u4e3a USER\u3002<br \/>\n&#8211;http-password=PASS    \u8bbe\u7f6e http \u5bc6\u7801\u4e3a PASS\u3002<br \/>\n&#8211;no-cache              \u4e0d\u5728\u670d\u52a1\u5668\u4e0a\u7f13\u5b58\u6570\u636e\u3002<br \/>\n&#8211;default-page=NAME     \u6539\u53d8\u9ed8\u8ba4\u9875<br \/>\n(\u9ed8\u8ba4\u9875\u901a\u5e38\u662f\u201cindex.html\u201d)\u3002<br \/>\n-E,  &#8211;adjust-extension      \u4ee5\u5408\u9002\u7684\u6269\u5c55\u540d\u4fdd\u5b58 HTML\/CSS \u6587\u6863\u3002<br \/>\n&#8211;ignore-length         \u5ffd\u7565\u5934\u90e8\u7684\u2018Content-Length\u2019\u533a\u57df\u3002<br \/>\n&#8211;header=STRING         \u5728\u5934\u90e8\u63d2\u5165 STRING\u3002<br \/>\n&#8211;max-redirect          \u6bcf\u9875\u6240\u5141\u8bb8\u7684\u6700\u5927\u91cd\u5b9a\u5411\u3002<br \/>\n&#8211;proxy-user=USER       \u4f7f\u7528 USER \u4f5c\u4e3a\u4ee3\u7406\u7528\u6237\u540d\u3002<br \/>\n&#8211;proxy-password=PASS   \u4f7f\u7528 PASS \u4f5c\u4e3a\u4ee3\u7406\u5bc6\u7801\u3002<br \/>\n&#8211;referer=URL           \u5728 HTTP \u8bf7\u6c42\u5934\u5305\u542b\u2018Referer: URL\u2019\u3002<br \/>\n&#8211;save-headers          \u5c06 HTTP \u5934\u4fdd\u5b58\u81f3\u6587\u4ef6\u3002<br \/>\n-U,  &#8211;user-agent=AGENT      \u6807\u8bc6\u4e3a AGENT \u800c\u4e0d\u662f Wget\/VERSION\u3002<br \/>\n&#8211;no-http-keep-alive    \u7981\u7528 HTTP keep-alive (\u6c38\u4e45\u8fde\u63a5)\u3002<br \/>\n&#8211;no-cookies            \u4e0d\u4f7f\u7528 cookies\u3002<br \/>\n&#8211;load-cookies=FILE     \u4f1a\u8bdd\u5f00\u59cb\u524d\u4ece FILE \u4e2d\u8f7d\u5165 cookies\u3002<br \/>\n&#8211;save-cookies=FILE     \u4f1a\u8bdd\u7ed3\u675f\u540e\u4fdd\u5b58 cookies \u81f3 FILE\u3002<br \/>\n&#8211;keep-session-cookies  \u8f7d\u5165\u5e76\u4fdd\u5b58\u4f1a\u8bdd (\u975e\u6c38\u4e45) cookies\u3002<br \/>\n&#8211;post-data=STRING      \u4f7f\u7528 POST \u65b9\u5f0f\uff1b\u628a STRING \u4f5c\u4e3a\u6570\u636e\u53d1\u9001\u3002<br \/>\n&#8211;post-file=FILE        \u4f7f\u7528 POST \u65b9\u5f0f\uff1b\u53d1\u9001 FILE \u5185\u5bb9\u3002<br \/>\n&#8211;content-disposition   \u5f53\u9009\u4e2d\u672c\u5730\u6587\u4ef6\u540d\u65f6<br \/>\n\u5141\u8bb8 Content-Disposition \u5934\u90e8 (\u5c1a\u5728\u5b9e\u9a8c)\u3002<br \/>\n&#8211;auth-no-challenge     \u53d1\u9001\u4e0d\u542b\u670d\u52a1\u5668\u8be2\u95ee\u7684\u9996\u6b21\u7b49\u5f85<br \/>\n\u7684\u57fa\u672c HTTP \u9a8c\u8bc1\u4fe1\u606f\u3002<\/p>\n<p>HTTPS (SSL\/TLS) \u9009\u9879\uff1a<br \/>\n&#8211;secure-protocol=PR     \u9009\u62e9\u5b89\u5168\u534f\u8bae\uff0c\u53ef\u4ee5\u662f auto\u3001SSLv2\u3001<br \/>\nSSLv3 \u6216\u662f TLSv1 \u4e2d\u7684\u4e00\u4e2a\u3002<br \/>\n&#8211;no-check-certificate   \u4e0d\u8981\u9a8c\u8bc1\u670d\u52a1\u5668\u7684\u8bc1\u4e66\u3002<br \/>\n&#8211;certificate=FILE       \u5ba2\u6237\u7aef\u8bc1\u4e66\u6587\u4ef6\u3002<br \/>\n&#8211;certificate-type=TYPE  \u5ba2\u6237\u7aef\u8bc1\u4e66\u7c7b\u578b\uff0cPEM \u6216 DER\u3002<br \/>\n&#8211;private-key=FILE       \u79c1\u94a5\u6587\u4ef6\u3002<br \/>\n&#8211;private-key-type=TYPE  \u79c1\u94a5\u6587\u4ef6\u7c7b\u578b\uff0cPEM \u6216 DER\u3002<br \/>\n&#8211;ca-certificate=FILE    \u5e26\u6709\u4e00\u7ec4 CA \u8ba4\u8bc1\u7684\u6587\u4ef6\u3002<br \/>\n&#8211;ca-directory=DIR       \u4fdd\u5b58 CA \u8ba4\u8bc1\u7684\u54c8\u5e0c\u5217\u8868\u7684\u76ee\u5f55\u3002<br \/>\n&#8211;random-file=FILE       \u5e26\u6709\u751f\u6210 SSL PRNG \u7684\u968f\u673a\u6570\u636e\u7684\u6587\u4ef6\u3002<br \/>\n&#8211;egd-file=FILE          \u7528\u4e8e\u547d\u540d\u5e26\u6709\u968f\u673a\u6570\u636e\u7684 EGD \u5957\u63a5\u5b57\u7684\u6587\u4ef6\u3002<\/p>\n<p>FTP \u9009\u9879\uff1a<br \/>\n&#8211;ftp-user=USER         \u8bbe\u7f6e ftp \u7528\u6237\u540d\u4e3a USER\u3002<br \/>\n&#8211;ftp-password=PASS     \u8bbe\u7f6e ftp \u5bc6\u7801\u4e3a PASS\u3002<br \/>\n&#8211;no-remove-listing     \u4e0d\u8981\u5220\u9664\u2018.listing\u2019\u6587\u4ef6\u3002<br \/>\n&#8211;no-glob               \u4e0d\u5728 FTP \u6587\u4ef6\u540d\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u5c55\u5f00\u3002<br \/>\n&#8211;no-passive-ftp        \u7981\u7528\u201cpassive\u201d\u4f20\u8f93\u6a21\u5f0f\u3002<br \/>\n&#8211;retr-symlinks         \u9012\u5f52\u76ee\u5f55\u65f6\uff0c\u83b7\u53d6\u94fe\u63a5\u7684\u6587\u4ef6 (\u800c\u975e\u76ee\u5f55)\u3002<\/p>\n<p>\u9012\u5f52\u4e0b\u8f7d\uff1a<br \/>\n-r,  &#8211;recursive          \u6307\u5b9a\u9012\u5f52\u4e0b\u8f7d\u3002<br \/>\n-l,  &#8211;level=NUMBER       \u6700\u5927\u9012\u5f52\u6df1\u5ea6 (inf \u6216 0 \u4ee3\u8868\u65e0\u9650\u5236\uff0c\u5373\u5168\u90e8\u4e0b\u8f7d)\u3002<br \/>\n&#8211;delete-after       \u4e0b\u8f7d\u5b8c\u6210\u540e\u5220\u9664\u672c\u5730\u6587\u4ef6\u3002<br \/>\n-k,  &#8211;convert-links      \u8ba9\u4e0b\u8f7d\u5f97\u5230\u7684 HTML \u6216 CSS \u4e2d\u7684\u94fe\u63a5\u6307\u5411\u672c\u5730\u6587\u4ef6\u3002<br \/>\n-K,  &#8211;backup-converted   \u5728\u8f6c\u6362\u6587\u4ef6 X \u524d\u5148\u5c06\u5b83\u5907\u4efd\u4e3a X.orig\u3002<br \/>\n-m,  &#8211;mirror             -N -r -l inf &#8211;no-remove-listing \u7684\u7f29\u5199\u5f62\u5f0f\u3002<br \/>\n-p,  &#8211;page-requisites    \u4e0b\u8f7d\u6240\u6709\u7528\u4e8e\u663e\u793a HTML \u9875\u9762\u7684\u56fe\u7247\u4e4b\u7c7b\u7684\u5143\u7d20\u3002<br \/>\n&#8211;strict-comments    \u7528\u4e25\u683c\u65b9\u5f0f (SGML) \u5904\u7406 HTML \u6ce8\u91ca\u3002<\/p>\n<p>\u9012\u5f52\u63a5\u53d7\/\u62d2\u7edd\uff1a<br \/>\n-A,  &#8211;accept=LIST               \u9017\u53f7\u5206\u9694\u7684\u53ef\u63a5\u53d7\u7684\u6269\u5c55\u540d\u5217\u8868\u3002<br \/>\n-R,  &#8211;reject=LIST               \u9017\u53f7\u5206\u9694\u7684\u8981\u62d2\u7edd\u7684\u6269\u5c55\u540d\u5217\u8868\u3002<br \/>\n-D,  &#8211;domains=LIST              \u9017\u53f7\u5206\u9694\u7684\u53ef\u63a5\u53d7\u7684\u57df\u5217\u8868\u3002<br \/>\n&#8211;exclude-domains=LIST      \u9017\u53f7\u5206\u9694\u7684\u8981\u62d2\u7edd\u7684\u57df\u5217\u8868\u3002<br \/>\n&#8211;follow-ftp                \u8ddf\u8e2a HTML \u6587\u6863\u4e2d\u7684 FTP \u94fe\u63a5\u3002<br \/>\n&#8211;follow-tags=LIST          \u9017\u53f7\u5206\u9694\u7684\u8ddf\u8e2a\u7684 HTML \u6807\u8bc6\u5217\u8868\u3002<br \/>\n&#8211;ignore-tags=LIST          \u9017\u53f7\u5206\u9694\u7684\u5ffd\u7565\u7684 HTML \u6807\u8bc6\u5217\u8868\u3002<br \/>\n-H,  &#8211;span-hosts                \u9012\u5f52\u65f6\u8f6c\u5411\u5916\u90e8\u4e3b\u673a\u3002<br \/>\n-L,  &#8211;relative                  \u53ea\u8ddf\u8e2a\u6709\u5173\u7cfb\u7684\u94fe\u63a5\u3002<br \/>\n-I,  &#8211;include-directories=LIST  \u5141\u8bb8\u76ee\u5f55\u7684\u5217\u8868\u3002<br \/>\n&#8211;trust-server-names             use the name specified by the redirection<br \/>\nurl last component.<br \/>\n-X,  &#8211;exclude-directories=LIST  \u6392\u9664\u76ee\u5f55\u7684\u5217\u8868\u3002<br \/>\n-np, &#8211;no-parent                 \u4e0d\u8ffd\u6eaf\u81f3\u7236\u76ee\u5f55\u3002<br \/>\n\u53c2\u6570\u6709\u70b9\u591a\uff0c\u6ca1\u5173\u7cfb\uff0c\u5e38\u7528\u7684\u638c\u63e1\uff0c\u5176\u4ed6\u7684\u7528\u7684\u65f6\u5019\u518d\u67e5<\/p>\n<p>wget\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u4e0b\u8f7d\u67d0\u4e2a\u6587\u4ef6\uff0cwget \u6587\u4ef6\u7684\u5730\u5740<\/h1>\n<p>$wget <a href=\"https:\/\/blog.csdn.net\/qq_38646470\">https:\/\/blog.csdn.net\/qq_38646470<\/a><br \/>\nvmstat<br \/>\nvmstat\u4ecb\u7ecd<br \/>\nvmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity.<\/p>\n<p>vmstat\u62a5\u544a\u6709\u5173\u8fdb\u7a0b\uff0c\u5185\u5b58\uff0c\u9875\u9762\u8c03\u5ea6\uff0c\u5757IO\uff0c\u9677\u9631\uff0c\u78c1\u76d8\u548ccpu\u6d3b\u52a8\u7684\u4fe1\u606f\u3002<\/p>\n<p>vmstat\u53c2\u6570\u683c\u5f0f<br \/>\nvmstat [options] [delay [count]]<\/p>\n<p>vmstat\u547d\u4ee4\u53c2\u6570<br \/>\n-a\uff1a\u663e\u793a\u6d3b\u8dc3\u548c\u975e\u6d3b\u8dc3\u5185\u5b58<\/p>\n<p>-f\uff1a\u663e\u793a\u4ece\u7cfb\u7edf\u542f\u52a8\u81f3\u4eca\u7684fork\u6570\u91cf \u3002<\/p>\n<p>-m\uff1a\u663e\u793aslabinfo<\/p>\n<p>-n\uff1a\u53ea\u5728\u5f00\u59cb\u65f6\u663e\u793a\u4e00\u6b21\u5404\u5b57\u6bb5\u540d\u79f0\u3002<\/p>\n<p>-s\uff1a\u663e\u793a\u5185\u5b58\u76f8\u5173\u7edf\u8ba1\u4fe1\u606f\u53ca\u591a\u79cd\u7cfb\u7edf\u6d3b\u52a8\u6570\u91cf\u3002<\/p>\n<p>delay\uff1a\u5237\u65b0\u65f6\u95f4\u95f4\u9694\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u53ea\u663e\u793a\u4e00\u6761\u7ed3\u679c\u3002<\/p>\n<p>count\uff1a\u5237\u65b0\u6b21\u6570\u3002\u5982\u679c\u4e0d\u6307\u5b9a\u5237\u65b0\u6b21\u6570\uff0c\u4f46\u6307\u5b9a\u4e86\u5237\u65b0\u65f6\u95f4\u95f4\u9694\uff0c\u8fd9\u65f6\u5237\u65b0\u6b21\u6570\u4e3a\u65e0\u7a77\u3002<\/p>\n<p>-d\uff1a\u663e\u793a\u78c1\u76d8\u76f8\u5173\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<p>-p\uff1a\u663e\u793a\u6307\u5b9a\u78c1\u76d8\u5206\u533a\u7edf\u8ba1\u4fe1\u606f<\/p>\n<p>-S\uff1a\u4f7f\u7528\u6307\u5b9a\u5355\u4f4d\u663e\u793a\u3002\u53c2\u6570\u6709 k \u3001K \u3001m \u3001M \uff0c\u5206\u522b\u4ee3\u88681000\u30011024\u30011000000\u30011048576\u5b57\u8282\uff08byte\uff09\u3002\u9ed8\u8ba4\u5355\u4f4d\u4e3aK\uff081024 bytes\uff09<\/p>\n<p>vmstat\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u663e\u793a\u865a\u62df\u5185\u5b58\u60c5\u51b5<\/h1>\n<p>$ vmstat<br \/>\nprocs &#8212;&#8212;&#8212;&#8211;memory&#8212;&#8212;&#8212;- &#8212;swap&#8211; &#8212;&#8211;io&#8212;- -system&#8211; &#8212;&#8212;cpu&#8212;&#8211;<br \/>\nr  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st<br \/>\n1  0      0 23764228 507816 36953948    0    0     3     5    0    0  1  0 98  0  0<br \/>\n\u89e3\u91ca<br \/>\nProcs\uff08\u8fdb\u7a0b\uff09\uff1a<\/p>\n<p>r: \u8fd0\u884c\u961f\u5217\u4e2d\u8fdb\u7a0b\u6570\u91cf<\/p>\n<p>b: \u7b49\u5f85IO\u7684\u8fdb\u7a0b\u6570\u91cf<\/p>\n<p>Memory\uff08\u5185\u5b58\uff09\uff1a<\/p>\n<p>swpd: \u4f7f\u7528\u865a\u62df\u5185\u5b58\u5927\u5c0f<\/p>\n<p>free: \u53ef\u7528\u5185\u5b58\u5927\u5c0f<\/p>\n<p>buff: \u7528\u4f5c\u7f13\u51b2\u7684\u5185\u5b58\u5927\u5c0f<\/p>\n<p>cache: \u7528\u4f5c\u7f13\u5b58\u7684\u5185\u5b58\u5927\u5c0f<\/p>\n<p>Swap\uff1a<\/p>\n<p>si: \u6bcf\u79d2\u4ece\u4ea4\u6362\u533a\u5199\u5230\u5185\u5b58\u7684\u5927\u5c0f<\/p>\n<p>so: \u6bcf\u79d2\u5199\u5165\u4ea4\u6362\u533a\u7684\u5185\u5b58\u5927\u5c0f<\/p>\n<p>IO\uff1a\uff08\u73b0\u5728\u7684Linux\u7248\u672c\u5757\u7684\u5927\u5c0f\u4e3a1024bytes\uff09<\/p>\n<p>bi: \u6bcf\u79d2\u8bfb\u53d6\u7684\u5757\u6570<\/p>\n<p>bo: \u6bcf\u79d2\u5199\u5165\u7684\u5757\u6570<\/p>\n<p>\u7cfb\u7edf\uff1a<\/p>\n<p>in: \u6bcf\u79d2\u4e2d\u65ad\u6570\uff0c\u5305\u62ec\u65f6\u949f\u4e2d\u65ad\u3002<\/p>\n<p>cs: \u6bcf\u79d2\u4e0a\u4e0b\u6587\u5207\u6362\u6570\u3002<\/p>\n<p>CPU\uff08\u4ee5\u767e\u5206\u6bd4\u8868\u793a\uff09\uff1a<\/p>\n<p>us: \u7528\u6237\u8fdb\u7a0b\u6267\u884c\u65f6\u95f4(user time)<\/p>\n<p>sy: \u7cfb\u7edf\u8fdb\u7a0b\u6267\u884c\u65f6\u95f4(system time)<\/p>\n<p>id: \u7a7a\u95f2\u65f6\u95f4(\u5305\u62ecIO\u7b49\u5f85\u65f6\u95f4),\u4e2d\u592e\u5904\u7406\u5668\u7684\u7a7a\u95f2\u65f6\u95f4 \u3002\u4ee5\u767e\u5206\u6bd4\u8868\u793a\u3002<\/p>\n<p>wa: \u7b49\u5f85IO\u65f6\u95f4<\/p>\n<h1>\u8868\u793a\u57283\u79d2\u65f6\u95f4\u5185\u8fdb\u884c3\u6b21\u91c7\u6837\u3002\u5c06\u5f97\u5230\u4e00\u4e2a\u6570\u636e\u6c47\u603b\u4ed6\u80fd\u591f\u53cd\u6620\u771f\u6b63\u7684\u7cfb\u7edf\u60c5\u51b5\u3002<\/h1>\n<p>$vmstat 3 3<\/p>\n<h1>\u67e5\u770b\u7cfb\u7edffork\u591a\u5c11\u6b21<\/h1>\n<p>$ vmstat -f<br \/>\n166484246 forks<\/p>\n<h1>\u67e5\u770b\u5185\u5b58\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f<\/h1>\n<p>$vmstat -s<\/p>\n<h1>\u67e5\u770b\u78c1\u76d8\u7684\u8bfb\/\u5199<\/h1>\n<p>$vmstat -d<\/p>\n<h1>\u67e5\u770b\u7cfb\u7edf\u7684slab\u4fe1\u606f<\/h1>\n<p>$vmstat -m<br \/>\nfree<br \/>\nfree\u4ecb\u7ecd<br \/>\nfree  displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel.<\/p>\n<p>free\u663e\u793a\u7cfb\u7edf\u4e2d\u53ef\u7528\u548c\u53ef\u7528\u7684\u7269\u7406\u5185\u5b58\u548c\u4ea4\u6362\u5185\u5b58\u7684\u603b\u91cf\uff0c\u4ee5\u53ca\u5185\u6838\u4f7f\u7528\u7684\u7f13\u51b2\u533a\u548c\u9ad8\u901f\u7f13\u5b58\u3002<\/p>\n<p>free\u53c2\u6570\u683c\u5f0f<br \/>\nfree [options]<\/p>\n<p>free\u547d\u4ee4\u53c2\u6570<br \/>\n-b \u4ee5Byte\u4e3a\u5355\u4f4d\u663e\u793a\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>-k \u4ee5KB\u4e3a\u5355\u4f4d\u663e\u793a\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>-m \u4ee5MB\u4e3a\u5355\u4f4d\u663e\u793a\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>-g  \u4ee5GB\u4e3a\u5355\u4f4d\u663e\u793a\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>-o \u4e0d\u663e\u793a\u7f13\u51b2\u533a\u8c03\u8282\u5217\u3002<\/p>\n<p>-s&lt;\u95f4\u9694\u79d2\u6570&gt; \u6301\u7eed\u89c2\u5bdf\u5185\u5b58\u4f7f\u7528\u72b6\u51b5\u3002<\/p>\n<p>-t \u663e\u793a\u5185\u5b58\u603b\u548c\u5217\u3002<\/p>\n<p>free\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>\u663e\u793a\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/h1>\n<p>$ free<br \/>\ntotal        used        free      shared  buff\/cache   available<br \/>\nMem:       65808884     4582700    23754736         684    37471448    60913052<br \/>\n$ free -h<br \/>\ntotal        used        free      shared  buff\/cache   available<br \/>\nMem:            62G        4.4G         22G        684K         35G         58G<br \/>\nSwap:            0B          0B          0B<br \/>\n\u89e3\u91ca<br \/>\ntotal:\u603b\u8ba1\u7269\u7406\u5185\u5b58\u7684\u5927\u5c0f\u3002<\/p>\n<p>used:\u5df2\u4f7f\u7528\u591a\u5927\u3002<\/p>\n<p>free:\u53ef\u7528\u6709\u591a\u5c11\u3002<\/p>\n<p>Shared:\u591a\u4e2a\u8fdb\u7a0b\u5171\u4eab\u7684\u5185\u5b58\u603b\u989d\u3002<\/p>\n<p>Buffers\/cached:\u78c1\u76d8\u7f13\u5b58\u7684\u5927\u5c0f\u3002<\/p>\n<p>\u7b2c\u4e09\u884c(-\/+ buffers\/cached):<\/p>\n<p>used:\u5df2\u4f7f\u7528\u591a\u5927\u3002<\/p>\n<p>free:\u53ef\u7528\u6709\u591a\u5c11\u3002<\/p>\n<h1>\u5468\u671f\u6027\u7684\u67e5\u8be2\u5185\u5b58\u4f7f\u7528\u4fe1\u606f\uff0c5s\u6267\u884c\u4e00\u6b21<\/h1>\n<p>$ free -s 5<br \/>\ntop<br \/>\ntop\u4ecb\u7ecd<br \/>\nThe  top  program provides a dynamic real-time view of a running system.  It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel.  The types of system summary information shown and the types, order and size of information displayed for  processes  are  all  user configurable and that configuration can be made persistent across restarts.<br \/>\nThe  program  provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal configuration  &#8212;  encompassing every aspect of its operation.  And while top is referred to throughout this document, you are free to name the program anything you wish.  That new name, possibly  an alias, will then be reflected on top&#8217;s display and used when reading and writing a configuration file.<\/p>\n<p>top\u7a0b\u5e8f\u63d0\u4f9b\u6b63\u5728\u8fd0\u884c\u7684\u7cfb\u7edf\u7684\u52a8\u6001\u5b9e\u65f6\u89c6\u56fe\u3002 \u5b83\u53ef\u4ee5\u663e\u793a\u7cfb\u7edf\u6458\u8981\u4fe1\u606f\u4ee5\u53caLinux\u5185\u6838\u5f53\u524d\u6b63\u5728\u7ba1\u7406\u7684\u8fdb\u7a0b\u6216\u7ebf\u7a0b\u7684\u5217\u8868\u3002 \u6240\u663e\u793a\u7684\u7cfb\u7edf\u6458\u8981\u4fe1\u606f\u7684\u7c7b\u578b\u4ee5\u53ca\u4e3a\u8fdb\u7a0b\u663e\u793a\u7684\u4fe1\u606f\u7684\u7c7b\u578b\uff0c\u987a\u5e8f\u548c\u5927\u5c0f\u90fd\u662f\u7528\u6237\u53ef\u914d\u7f6e\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u914d\u7f6e\u5728\u91cd\u65b0\u542f\u52a8\u540e\u4fdd\u6301\u4e0d\u53d8\u3002<br \/>\n\u8be5\u7a0b\u5e8f\u4e3a\u6d41\u7a0b\u64cd\u4f5c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6709\u9650\u7684\u4ea4\u4e92\u5f0f\u754c\u9762\uff0c\u5e76\u4e3a\u4e2a\u4eba\u914d\u7f6e\u63d0\u4f9b\u4e86\u66f4\u4e3a\u5e7f\u6cdb\u7684\u754c\u9762-\u6db5\u76d6\u4e86\u5176\u64cd\u4f5c\u7684\u5404\u4e2a\u65b9\u9762\u3002 \u5c3d\u7ba1\u5728\u672c\u6587\u6863\u4e2d\u59cb\u7ec8\u5f15\u7528top\uff0c\u4f46\u662f\u60a8\u53ef\u4ee5\u968f\u610f\u4e3a\u7a0b\u5e8f\u547d\u540d\u3002 \u7136\u540e\uff0c\u8be5\u65b0\u540d\u79f0\uff08\u53ef\u80fd\u662f\u522b\u540d\uff09\u5c06\u53cd\u6620\u5728\u9876\u90e8\u7684\u663e\u793a\u5c4f\u4e0a\uff0c\u5e76\u5728\u8bfb\u5199\u914d\u7f6e\u6587\u4ef6\u65f6\u4f7f\u7528\u3002<\/p>\n<p>top\u53c2\u6570\u683c\u5f0f<br \/>\ntop -hv|-bcHiOSs -d secs -n max -u|U user -p pid -o fld -w [cols]<\/p>\n<p>top\u547d\u4ee4\u53c2\u6570<br \/>\n-b \u6279\u5904\u7406<\/p>\n<p>-c \u663e\u793a\u5b8c\u6574\u7684\u6cbb\u547d\u4ee4<\/p>\n<p>-I \u5ffd\u7565\u5931\u6548\u8fc7\u7a0b<\/p>\n<p>-s \u4fdd\u5bc6\u6a21\u5f0f<\/p>\n<p>-S \u7d2f\u79ef\u6a21\u5f0f<\/p>\n<p>-i&lt;\u65f6\u95f4&gt; \u8bbe\u7f6e\u95f4\u9694\u65f6\u95f4<\/p>\n<p>-u&lt;\u7528\u6237\u540d&gt; \u6307\u5b9a\u7528\u6237\u540d<\/p>\n<p>-p&lt;\u8fdb\u7a0b\u53f7&gt; \u6307\u5b9a\u8fdb\u7a0b<\/p>\n<p>-n&lt;\u6b21\u6570&gt; \u5faa\u73af\u663e\u793a\u7684\u6b21\u6570<\/p>\n<p>top\u5e38\u7528\u53c2\u6570\u793a\u4f8b<\/p>\n<h1>top<\/h1>\n<p>$ top<br \/>\ntop &#8211; 00:56:07 up 149 days, 14:40,  1 user,  load average: 0.00, 0.02, 0.05<br \/>\nTasks: 254 total,   1 running, 253 sleeping,   0 stopped,   0 zombie<br \/>\n%Cpu(s):  1.4 us,  0.3 sy,  0.0 ni, 98.3 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st<br \/>\nKiB Mem : 65808884 total, 23749772 free,  4586160 used, 37472952 buff\/cache<br \/>\nKiB Swap:        0 total,        0 free,        0 used. 60909608 avail Mem<\/p>\n<p>PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND<br \/>\n24397 dongshan  20   0 17.972g 688312  13728 S   6.2  1.0   7:09.11 java<br \/>\n1 root      20   0   42140   3684   1476 S   0.0  0.0  23:58.88 systemd<br \/>\n2 root      20   0       0      0      0 S   0.0  0.0   0:05.47 kthreadd<br \/>\n3 root      20   0       0      0      0 S   0.0  0.0   0:16.06 ksoftirqd\/0<br \/>\n5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker\/0:0H<br \/>\n7 root      rt   0       0      0      0 S   0.0  0.0   1:27.00 migration\/0<br \/>\n8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh<br \/>\n9 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob\/0<br \/>\n\u89e3\u91ca<br \/>\n\u7b2c\u4e00\u884c\uff0c\u4efb\u52a1\u961f\u5217\u4fe1\u606f\uff0c\u540c uptime \u547d\u4ee4\u7684\u6267\u884c\u7ed3\u679c\uff0c\u5177\u4f53\u53c2\u6570\u8bf4\u660e\u60c5\u51b5\u5982\u4e0b\uff1a<\/p>\n<p>00:56:07 \u2014 \u5f53\u524d\u7cfb\u7edf\u65f6\u95f4<\/p>\n<p>up 149 days, 14:40 \u2014 \u7cfb\u7edf\u5df2\u7ecf\u8fd0\u884c\u4e86149\u592914\u5c0f\u65f640\u5206\u949f\uff08\u5728\u8fd9\u671f\u95f4\u7cfb\u7edf\u6ca1\u6709\u91cd\u542f\u8fc7\u7684\uff09<\/p>\n<p>1users \u2014 \u5f53\u524d\u67091\u4e2a\u7528\u6237\u767b\u5f55\u7cfb\u7edf<\/p>\n<p>load average: 0.00, 0.02, 0.05 \u2014 load average\u540e\u9762\u7684\u4e09\u4e2a\u6570\u5206\u522b\u662f1\u5206\u949f\u30015\u5206\u949f\u300115\u5206\u949f\u7684\u8d1f\u8f7d\u60c5\u51b5\u3002<\/p>\n<p>load average\u6570\u636e\u662f\u6bcf\u96945\u79d2\u949f\u68c0\u67e5\u4e00\u6b21\u6d3b\u8dc3\u7684\u8fdb\u7a0b\u6570\uff0c\u7136\u540e\u6309\u7279\u5b9a\u7b97\u6cd5\u8ba1\u7b97\u51fa\u7684\u6570\u503c\u3002\u5982\u679c\u8fd9\u4e2a\u6570\u9664\u4ee5\u903b\u8f91CPU\u7684\u6570\u91cf\uff0c\u7ed3\u679c\u9ad8\u4e8e5\u7684\u65f6\u5019\u5c31\u8868\u660e\u7cfb\u7edf\u5728\u8d85\u8d1f\u8377\u8fd0\u8f6c\u4e86\u3002<\/p>\n<p>\u7b2c\u4e8c\u884c\uff0cTasks \u2014 \u4efb\u52a1\uff08\u8fdb\u7a0b\uff09<\/p>\n<p>\u7cfb\u7edf\u73b0\u5728\u5171\u6709254\u4e2a\u8fdb\u7a0b\uff0c\u5176\u4e2d\u5904\u4e8e\u8fd0\u884c\u4e2d\u7684\u67091\u4e2a\uff0c253\u4e2a\u5728\u4f11\u7720\uff08sleep\uff09\uff0cstoped\u72b6\u6001\u7684\u67090\u4e2a\uff0czombie\u72b6\u6001\uff08\u50f5\u5c38\uff09\u7684\u67090\u4e2a\u3002<\/p>\n<p>\u7b2c\u4e09\u884c\uff0ccpu\u72b6\u6001\u4fe1\u606f<\/p>\n<p>%Cpu(s):  1.4 us,  0.3 sy,  0.0 ni, 98.3 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st<\/p>\n<p>1.4 us \u2014 \u7528\u6237\u7a7a\u95f4\u5360\u7528CPU\u7684\u767e\u5206\u6bd4\u3002<\/p>\n<p>0.3 sy \u2014 \u5185\u6838\u7a7a\u95f4\u5360\u7528CPU\u7684\u767e\u5206\u6bd4\u3002<\/p>\n<p>0.0 ni \u2014 \u6539\u53d8\u8fc7\u4f18\u5148\u7ea7\u7684\u8fdb\u7a0b\u5360\u7528CPU\u7684\u767e\u5206\u6bd4<\/p>\n<p>98.3 id \u2014 \u7a7a\u95f2CPU\u767e\u5206\u6bd4<\/p>\n<p>0.1 wa \u2014 IO\u7b49\u5f85\u5360\u7528CPU\u7684\u767e\u5206\u6bd4<\/p>\n<p>0.0 hi \u2014 \u786c\u4e2d\u65ad\uff08Hardware IRQ\uff09\u5360\u7528CPU\u7684\u767e\u5206\u6bd4<\/p>\n<p>0.0 si \u2014 \u8f6f\u4e2d\u65ad\uff08Software Interrupts\uff09\u5360\u7528CPU\u7684\u767e\u5206\u6bd4<\/p>\n<p>\u7b2c\u56db\u884c,\u5185\u5b58\u72b6\u6001<\/p>\n<p>65808884 total  \u7269\u7406\u5185\u5b58\u603b\u91cf<\/p>\n<p>23749772 free  \u4f7f\u7528\u4e2d\u7684\u5185\u5b58\u603b\u91cf<\/p>\n<p>4586160 used   \u7a7a\u95f2\u5185\u5b58\u603b\u91cf<\/p>\n<p>37472952 buff\/cache  \u7f13\u5b58\u7684\u5185\u5b58\u91cf<\/p>\n<p>\u7b2c\u4e94\u884c\uff0cswap\u4ea4\u6362\u5206\u533a\u4fe1\u606f<\/p>\n<p>0 total   \u4ea4\u6362\u533a\u603b\u91cf<\/p>\n<p>0 use   \u4f7f\u7528\u7684\u4ea4\u6362\u533a\u603b\u91cf<\/p>\n<p>0 free   \u7a7a\u95f2\u4ea4\u6362\u533a\u603b\u91cf<\/p>\n<p>60909608 avail Mem  \u53ef\u7528\u4ea4\u6362\u533a\u603b\u91cf<\/p>\n<p>\u7b2c\u4e03\u884c\u4ee5\u4e0b\uff1a\u5404\u8fdb\u7a0b\uff08\u4efb\u52a1\uff09\u7684\u72b6\u6001\u76d1\u63a7<\/p>\n<p>PID \u2014 \u8fdb\u7a0bid<\/p>\n<p>USER \u2014 \u8fdb\u7a0b\u6240\u6709\u8005<\/p>\n<p>PR \u2014 \u8fdb\u7a0b\u4f18\u5148\u7ea7<\/p>\n<p>NI \u2014 nice\u503c\u3002\u8d1f\u503c\u8868\u793a\u9ad8\u4f18\u5148\u7ea7\uff0c\u6b63\u503c\u8868\u793a\u4f4e\u4f18\u5148\u7ea7<\/p>\n<p>VIRT \u2014 \u8fdb\u7a0b\u4f7f\u7528\u7684\u865a\u62df\u5185\u5b58\u603b\u91cf\uff0c\u5355\u4f4dkb\u3002VIRT=SWAP+RES<\/p>\n<p>RES \u2014 \u8fdb\u7a0b\u4f7f\u7528\u7684\u3001\u672a\u88ab\u6362\u51fa\u7684\u7269\u7406\u5185\u5b58\u5927\u5c0f\uff0c\u5355\u4f4dkb\u3002RES=CODE+DATA<\/p>\n<p>SHR \u2014 \u5171\u4eab\u5185\u5b58\u5927\u5c0f\uff0c\u5355\u4f4dkb<\/p>\n<p>S \u2014 \u8fdb\u7a0b\u72b6\u6001\u3002D=\u4e0d\u53ef\u4e2d\u65ad\u7684\u7761\u7720\u72b6\u6001 R=\u8fd0\u884c S=\u7761\u7720 T=\u8ddf\u8e2a\/\u505c\u6b62 Z=\u50f5\u5c38\u8fdb\u7a0b<\/p>\n<p>%CPU \u2014 \u4e0a\u6b21\u66f4\u65b0\u5230\u73b0\u5728\u7684CPU\u65f6\u95f4\u5360\u7528\u767e\u5206\u6bd4<\/p>\n<p>%MEM \u2014 \u8fdb\u7a0b\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u767e\u5206\u6bd4<\/p>\n<p>TIME+ \u2014 \u8fdb\u7a0b\u4f7f\u7528\u7684CPU\u65f6\u95f4\u603b\u8ba1\uff0c\u5355\u4f4d1\/100\u79d2<\/p>\n<p>COMMAND \u2014 \u8fdb\u7a0b\u540d\u79f0\uff08\u547d\u4ee4\u540d\/\u547d\u4ee4\u884c\uff09<\/p>\n<p>sar<br \/>\nsar\u4ecb\u7ecd<br \/>\nsar\uff08System Activity Reporter\u7cfb\u7edf\u6d3b\u52a8\u60c5\u51b5\u62a5\u544a\uff09\u662f\u76ee\u524d Linux \u4e0a\u6700\u4e3a\u5168\u9762\u7684\u7cfb\u7edf\u6027\u80fd\u5206\u6790\u5de5\u5177\u4e4b\u4e00\uff0c\u53ef\u4ee5\u4ece\u591a\u65b9\u9762\u5bf9\u7cfb\u7edf\u7684\u6d3b\u52a8\u8fdb\u884c\u62a5\u544a\uff0c\u5305\u62ec\uff1a\u6587\u4ef6\u7684\u8bfb\u5199\u60c5\u51b5\u3001 \u7cfb\u7edf\u8c03\u7528\u7684\u4f7f\u7528\u60c5\u51b5\u3001\u78c1\u76d8I\/O\u3001CPU\u6548\u7387\u3001\u5185\u5b58\u4f7f\u7528\u72b6\u51b5\u3001\u8fdb\u7a0b\u6d3b\u52a8\u53caIPC\u6709\u5173\u7684\u6d3b\u52a8\u7b49\u3002<\/p>\n<p>sar\u53c2\u6570\u683c\u5f0f<br \/>\nsar [options] [-A] [-o file] t [n]<\/p>\n<p>sar\u547d\u4ee4\u53c2\u6570<br \/>\n-A\uff1a\u6240\u6709\u62a5\u544a\u7684\u603b\u548c<\/p>\n<p>-u\uff1a\u8f93\u51faCPU\u4f7f\u7528\u60c5\u51b5\u7684\u7edf\u8ba1\u4fe1\u606f<\/p>\n<p>-v\uff1a\u8f93\u51fainode\u3001\u6587\u4ef6\u548c\u5176\u4ed6\u5185\u6838\u8868\u7684\u7edf\u8ba1\u4fe1\u606f<\/p>\n<p>-d\uff1a\u8f93\u51fa\u6bcf\u4e00\u4e2a\u5757\u8bbe\u5907\u7684\u6d3b\u52a8\u4fe1\u606f<\/p>\n<p>-r\uff1a\u8f93\u51fa\u5185\u5b58\u548c\u4ea4\u6362\u7a7a\u95f4\u7684\u7edf\u8ba1\u4fe1\u606f<\/p>\n<p>-b\uff1a\u663e\u793aI\/O\u548c\u4f20\u9001\u901f\u7387\u7684\u7edf\u8ba1\u4fe1\u606f<\/p>\n<p>-a\uff1a\u6587\u4ef6\u8bfb\u5199\u60c5\u51b5<\/p>\n<p>-c\uff1a\u8f93\u51fa\u8fdb\u7a0b\u7edf\u8ba1\u4fe1\u606f\uff0c\u6bcf\u79d2\u521b\u5efa\u7684\u8fdb\u7a0b\u6570<\/p>\n<p>-R\uff1a\u8f93\u51fa\u5185\u5b58\u9875\u9762\u7684\u7edf\u8ba1\u4fe1\u606f<\/p>\n<p>-y\uff1a\u7ec8\u7aef\u8bbe\u5907\u6d3b\u52a8\u60c5\u51b5<\/p>\n<p>-w\uff1a\u8f93\u51fa\u7cfb\u7edf\u4ea4\u6362\u6d3b\u52a8\u4fe1\u606f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e8f\u8a00 \u2003\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u8bb2\u89e3\u4e86\u4e00\u4e9blinux\u5e38\u7528\u547d\u4ee4\uff0c\u4e3b\u8981\u8bb2\u89e3\u6a21\u5f0f\u662f\uff0c\u547d\u4ee4\u4ecb\u7ecd\u3001\u547d\u4ee4\u53c2\u6570\u683c\u5f0f\u3001\u547d\u4ee4\u53c2\u6570\u3001\u547d\u4ee4\u5e38\u7528\u53c2&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":0,"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ppdd.vip\/index.php\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}