{"id":941,"date":"2022-07-18T18:37:49","date_gmt":"2022-07-18T10:37:49","guid":{"rendered":"http:\/\/www.rchen.top\/?p=941"},"modified":"2022-07-18T18:47:12","modified_gmt":"2022-07-18T10:47:12","slug":"%e4%b8%80%e4%ba%9b%e5%b8%b8%e7%94%a8%e7%9a%84linux%e6%8c%87%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.rchen.top\/?p=941","title":{"rendered":"\u4e00\u4e9b\u5e38\u7528\u7684linux\u6307\u4ee4"},"content":{"rendered":"<div>\n<div>\n<div>\n<div>\n<div>\n<div>\n<p><span lang=\"en-US\">0.<\/span><span lang=\"zh-CN\">\u67e5\u770b<\/span><span lang=\"en-US\">linux<\/span><span lang=\"zh-CN\">\u7248\u672c<\/span><\/p>\n<p>cat \/etc\/os-release<\/p>\n<p>1. tar<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684tar\u6587\u4ef6<\/p>\n<p>$\u00a0tar\u00a0cvf\u00a0archive_name.tar\u00a0dirname\/<\/p>\n<p>\u89e3\u538btar\u6587\u4ef6<\/p>\n<p>$\u00a0tar\u00a0xvf\u00a0archive_name.tar<\/p>\n<p>\u67e5\u770btar\u6587\u4ef6<\/p>\n<p>$\u00a0tar\u00a0tvf\u00a0archive_name.tar<\/p>\n<p>2. grep<\/p>\n<p>\u5728\u6587\u4ef6\u4e2d\u67e5\u627e\u5b57\u7b26\u4e32(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)<\/p>\n<p>$\u00a0grep\u00a0-i\u00a0&#8220;the&#8221;\u00a0demo_file<\/p>\n<p>\u8f93\u51fa\u6210\u529f\u5339\u914d\u7684\u884c\uff0c\u4ee5\u53ca\u8be5\u884c\u4e4b\u540e\u7684\u4e09\u884c<\/p>\n<p>$\u00a0grep\u00a0-A\u00a03\u00a0-i\u00a0&#8220;example&#8221;\u00a0demo_text<\/p>\n<p>\u5728\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\u9012\u5f52\u67e5\u8be2\u5305\u542b\u6307\u5b9a\u5b57\u7b26\u4e32\u7684\u6587\u4ef6<\/p>\n<p>$\u00a0grep\u00a0-r\u00a0&#8220;ramesh&#8221;\u00a0*<\/p>\n<p>3. find<\/p>\n<p>\u67e5\u627e\u6307\u5b9a\u6587\u4ef6\u540d\u7684\u6587\u4ef6(\u4e0d\u533a\u5206\u5927\u5c0f\u5199)<\/p>\n<p>$\u00a0find\u00a0-iname\u00a0&#8220;MyProgram.c&#8221;<\/p>\n<p>\u5bf9\u627e\u5230\u7684\u6587\u4ef6\u6267\u884c\u67d0\u4e2a\u547d\u4ee4<\/p>\n<p>$\u00a0find\u00a0-iname\u00a0&#8220;MyProgram.c&#8221;\u00a0-exec\u00a0md5sum\u00a0{}\u00a0\\;<\/p>\n<p>\u67e5\u627ehome\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u7a7a\u6587\u4ef6<\/p>\n<p>$\u00a0find\u00a0~\u00a0-empty<\/p>\n<p>4. ssh<\/p>\n<p>\u767b\u5f55\u5230\u8fdc\u7a0b\u4e3b\u673a<\/p>\n<p>$\u00a0ssh\u00a0-l\u00a0jsmith\u00a0remotehost.example.com<\/p>\n<p>\u8c03\u8bd5ssh\u5ba2\u6237\u7aef<\/p>\n<p>$\u00a0ssh\u00a0-v\u00a0-l\u00a0jsmith\u00a0remotehost.example.com<\/p>\n<p>\u663e\u793assh\u5ba2\u6237\u7aef\u7248\u672c<\/p>\n<p>$\u00a0ssh\u00a0-V<\/p>\n<p>5. sed<\/p>\n<p>\u5f53\u4f60\u5c06Dos\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u590d\u5236\u5230Unix\/Linux\u540e\uff0c\u8fd9\u4e2a\u6587\u4ef6\u6bcf\u884c\u90fd\u4f1a\u4ee5\\r\\n\u7ed3\u5c3e\uff0csed\u53ef\u4ee5\u8f7b\u6613\u5c06\u5176\u8f6c\u6362\u4e3aUnix\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u4f7f\u7528\\n\u7ed3\u5c3e\u7684\u6587\u4ef6<\/p>\n<p>$\u00a0sed\u00a0&#8216;s\/.$\/\/&#8217;\u00a0filename<\/p>\n<p>\u53cd\u8f6c\u6587\u4ef6\u5185\u5bb9\u5e76\u8f93\u51fa<\/p>\n<p>$ sed -n &#8216;1!G; h; p&#8217; filename<\/p>\n<p>\u4e3a\u975e\u7a7a\u884c\u6dfb\u52a0\u884c\u53f7<\/p>\n<p>$\u00a0sed\u00a0&#8216;\/.\/=&#8217;\u00a0thegeekstuff.txt\u00a0|\u00a0sed\u00a0&#8216;N;\u00a0s\/\\n\/\u00a0\/&#8217;<\/p>\n<p>6. awk<\/p>\n<p>\u5220\u9664\u91cd\u590d\u884c<\/p>\n<p>$\u00a0awk\u00a0&#8216;!($0\u00a0in\u00a0array)\u00a0{\u00a0array[$0];\u00a0print}&#8217;\u00a0temp<\/p>\n<p>\u6253\u5370\/etc\/passwd\u4e2d\u6240\u6709\u5305\u542b\u540c\u6837\u7684uid\u548cgid\u7684\u884c<\/p>\n<p>$\u00a0awk\u00a0-F\u00a0&#8216;:&#8217;\u00a0&#8216;$3=$4&#8217;\u00a0\/etc\/passwd<\/p>\n<p>\u6253\u5370\u6587\u4ef6\u4e2d\u7684\u6307\u5b9a\u90e8\u5206\u7684\u5b57\u6bb5<\/p>\n<p>$\u00a0awk\u00a0&#8216;{print\u00a0$2,$5;}&#8217;\u00a0employee.txt<\/p>\n<p>7. vim<\/p>\n<p>\u6253\u5f00\u6587\u4ef6\u5e76\u8df3\u5230\u7b2c10\u884c<\/p>\n<p>$\u00a0vim\u00a0+10\u00a0filename.txt<\/p>\n<p>\u6253\u5f00\u6587\u4ef6\u8df3\u5230\u7b2c\u4e00\u4e2a\u5339\u914d\u7684\u884c<\/p>\n<p>$\u00a0vim\u00a0+\/search-term\u00a0filename.txt<\/p>\n<p>\u4ee5\u53ea\u8bfb\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6<\/p>\n<p>$\u00a0vim\u00a0-R\u00a0\/etc\/passwd<\/p>\n<p>8. diff<\/p>\n<p>\u6bd4\u8f83\u7684\u65f6\u5019\u5ffd\u7565\u7a7a\u767d\u7b26<\/p>\n<p>$\u00a0diff\u00a0-w\u00a0name_list.txt\u00a0name_list_new.txt<\/p>\n<p>9. sort<\/p>\n<p>\u4ee5\u5347\u5e8f\u5bf9\u6587\u4ef6\u5185\u5bb9\u6392\u5e8f<\/p>\n<p>$\u00a0sort\u00a0names.txt<\/p>\n<p>\u4ee5\u964d\u5e8f\u5bf9\u6587\u4ef6\u5185\u5bb9\u6392\u5e8f<\/p>\n<p>$\u00a0sort\u00a0-r\u00a0names.txt<\/p>\n<p>\u4ee5\u7b2c\u4e09\u4e2a\u5b57\u6bb5\u5bf9\/etc\/passwd\u7684\u5185\u5bb9\u6392\u5e8f<\/p>\n<p>$\u00a0sort\u00a0-t:\u00a0-k\u00a03n\u00a0\/etc\/passwd\u00a0|\u00a0more<\/p>\n<p>10. export<\/p>\n<p>\u8f93\u51fa\u8ddf\u5b57\u7b26\u4e32oracle\u5339\u914d\u7684\u73af\u5883\u53d8\u91cf<\/p>\n<p>$\u00a0export\u00a0|\u00a0grep\u00a0ORCALE<\/p>\n<p>declare\u00a0-x\u00a0ORACLE_BASE=&#8221;\/u01\/app\/oracle&#8221;declare\u00a0-x\u00a0ORACLE_HOME=&#8221;\/u01\/app\/oracle\/product\/10.2.0&#8243;declare\u00a0-x\u00a0ORACLE_SID=&#8221;med&#8221;declare\u00a0-x\u00a0ORACLE_TERM=&#8221;xterm&#8221;<\/p>\n<p>\u8bbe\u7f6e\u5168\u5c40\u73af\u5883\u53d8\u91cf<\/p>\n<p>$\u00a0export\u00a0ORACLE_HOME=\/u01\/app\/oracle\/product\/10.2.0<\/p>\n<p>11. xargs<\/p>\n<p>\u5c06\u6240\u6709\u56fe\u7247\u6587\u4ef6\u62f7\u8d1d\u5230\u5916\u90e8\u9a71\u52a8\u5668<\/p>\n<p>$\u00a0ls\u00a0*.jpg\u00a0|\u00a0xargs\u00a0-n1\u00a0-i\u00a0cp\u00a0{}\u00a0\/external-hard-drive\/directory<\/p>\n<p>\u5c06\u7cfb\u7edf\u4e2d\u6240\u6709jpd\u6587\u4ef6\u538b\u7f29\u6253\u5305<\/p>\n<p>$\u00a0find\u00a0\/\u00a0-name\u00a0*.jpg\u00a0-type\u00a0f\u00a0-print\u00a0|\u00a0xargs\u00a0tar\u00a0-cvzf\u00a0images.tar.gz<\/p>\n<p>\u4e0b\u8f7d\u6587\u4ef6\u4e2d\u5217\u51fa\u7684\u6240\u6709url\u5bf9\u5e94\u7684\u9875\u9762<\/p>\n<p>$\u00a0cat\u00a0url-list.txt\u00a0|\u00a0xargs\u00a0wget\u00a0\u2013c<\/p>\n<p>12. ls<\/p>\n<p>\u4ee5\u6613\u8bfb\u7684\u65b9\u5f0f\u663e\u793a\u6587\u4ef6\u5927\u5c0f(\u663e\u793a\u4e3aMB,GB&#8230;)<\/p>\n<p>$\u00a0ls\u00a0-lh-rw-r&#8212;&#8211;\u00a01\u00a0ramesh\u00a0team-dev\u00a08.9M\u00a0Jun\u00a012\u00a015:27\u00a0arch-linux.txt.gz<\/p>\n<p>\u4ee5\u6700\u540e\u4fee\u6539\u65f6\u95f4\u5347\u5e8f\u5217\u51fa\u6587\u4ef6<\/p>\n<p>$\u00a0ls\u00a0-ltr<\/p>\n<p>\u5728\u6587\u4ef6\u540d\u540e\u9762\u663e\u793a\u6587\u4ef6\u7c7b\u578b<\/p>\n<p>$\u00a0ls\u00a0-F<\/p>\n<p>13. pwd<\/p>\n<p>\u8f93\u51fa\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/p>\n<p>14. cd<\/p>\n<p>cd -\u53ef\u4ee5\u5728\u6700\u8fd1\u5de5\u4f5c\u7684\u4e24\u4e2a\u76ee\u5f55\u95f4\u5207\u6362<\/p>\n<p>\u4f7f\u7528shopt -s cdspell\u53ef\u4ee5\u8bbe\u7f6e\u81ea\u52a8\u5bf9cd\u547d\u4ee4\u8fdb\u884c\u62fc\u5199\u68c0\u67e5<\/p>\n<p>15. gzip<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a*.gz\u7684\u538b\u7f29\u6587\u4ef6<\/p>\n<p>$\u00a0gzip\u00a0test.txt<\/p>\n<p>\u89e3\u538b*.gz\u6587\u4ef6<\/p>\n<p>$\u00a0gzip\u00a0-d\u00a0test.txt.gz<\/p>\n<p>\u663e\u793a\u538b\u7f29\u7684\u6bd4\u7387<\/p>\n<p>$\u00a0gzip\u00a0-l\u00a0*.gz<\/p>\n<p>16. bzip2<\/p>\n<p>\u521b\u5efa*.bz2\u538b\u7f29\u6587\u4ef6<\/p>\n<p>$\u00a0bzip2\u00a0test.txt<\/p>\n<p>\u89e3\u538b*.bz2\u6587\u4ef6<\/p>\n<p>bzip2\u00a0-d\u00a0test.txt.bz2<\/p>\n<p>17. uzip<\/p>\n<p>\u89e3\u538b*.zip\u6587\u4ef6<\/p>\n<p>$\u00a0unzip\u00a0test.zip<\/p>\n<p>18. shutdown<\/p>\n<p>\u5173\u95ed\u7cfb\u7edf\u5e76\u7acb\u5373\u5173\u673a<\/p>\n<p>$\u00a0shutdown\u00a0-h\u00a0now<\/p>\n<p>10\u5206\u949f\u540e\u5173\u673a<\/p>\n<p>$\u00a0shutdown\u00a0-h\u00a0+10<\/p>\n<p>\u91cd\u542f<\/p>\n<p>$\u00a0shutdown\u00a0-r\u00a0now<\/p>\n<p>\u91cd\u542f\u671f\u95f4\u5f3a\u5236\u8fdb\u884c\u7cfb\u7edf\u68c0\u67e5<\/p>\n<p>$\u00a0shutdown\u00a0-Fr\u00a0now<\/p>\n<p>19. ftp<\/p>\n<p>ftp\u547d\u4ee4\u548csftp\u547d\u4ee4\u7684\u7528\u6cd5\u57fa\u672c\u76f8\u4f3c\u8fde\u63a5ftp\u670d\u52a1\u5668\u5e76\u4e0b\u8f7d\u591a\u4e2a\u6587\u4ef6<\/p>\n<p>$\u00a0ftp\u00a0IP\/hostname<\/p>\n<p>ftp&gt;\u00a0mget\u00a0*.html<\/p>\n<p>\u663e\u793a\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u6587\u4ef6\u5217\u8868<\/p>\n<p>20. crontab<\/p>\n<p>\u67e5\u770b\u67d0\u4e2a\u7528\u6237\u7684crontab\u5165\u53e3<\/p>\n<p>$\u00a0crontab\u00a0-u\u00a0john\u00a0-l<\/p>\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u6bcf\u5341\u5206\u949f\u6267\u884c\u4e00\u6b21\u7684\u8ba1\u5212\u4efb\u52a1<\/p>\n<p>*\/10\u00a0*\u00a0*\u00a0*\u00a0*\u00a0\/home\/ramesh\/check-disk-space<\/p>\n<p>21. service<\/p>\n<p>service\u547d\u4ee4\u7528\u4e8e\u8fd0\u884cSystem V init\u811a\u672c\uff0c\u8fd9\u4e9b\u811a\u672c\u4e00\u822c\u4f4d\u4e8e\/etc\/init.d\u6587\u4ef6\u4e0b\uff0c\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u8fd9\u4e2a\u6587\u4ef6\u5939\u91cc\u9762\u7684\u811a\u672c\uff0c\u800c\u4e0d\u7528\u52a0\u4e0a\u8def\u5f84<\/p>\n<p>\u67e5\u770b\u670d\u52a1\u72b6\u6001<\/p>\n<p>$\u00a0service\u00a0ssh\u00a0status<\/p>\n<p>\u67e5\u770b\u6240\u6709\u670d\u52a1\u72b6\u6001<\/p>\n<p>$\u00a0service\u00a0&#8211;status-all<\/p>\n<p>\u91cd\u542f\u670d\u52a1<\/p>\n<p>$\u00a0service\u00a0ssh\u00a0restart<\/p>\n<p>22. ps<\/p>\n<p>ps\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u6b63\u5728\u8fd0\u884c\u4e2d\u7684\u8fdb\u7a0b\u7684\u4fe1\u606f\uff0cps\u547d\u4ee4\u6709\u5f88\u591a\u9009\u9879\uff0c\u8fd9\u91cc\u53ea\u5217\u51fa\u4e86\u51e0\u4e2a<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684\u6240\u6709\u8fdb\u7a0b<\/p>\n<p>$\u00a0ps\u00a0-ef\u00a0|\u00a0more<\/p>\n<p>\u4ee5\u6811\u72b6\u7ed3\u6784\u663e\u793a\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0cH\u9009\u9879\u8868\u793a\u663e\u793a\u8fdb\u7a0b\u7684\u5c42\u6b21\u7ed3\u6784<\/p>\n<p>$\u00a0ps\u00a0-efH\u00a0|\u00a0more<\/p>\n<p>23. free<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u7cfb\u7edf\u5f53\u524d\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u5305\u62ec\u5df2\u7528\u5185\u5b58\u3001\u53ef\u7528\u5185\u5b58\u548c\u4ea4\u6362\u5185\u5b58\u7684\u60c5\u51b5<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0bfree\u4f1a\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\u8f93\u51fa\u5185\u5b58\u7684\u4f7f\u7528\u91cf<\/p>\n<p>$\u00a0free<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u4ee5\u5176\u4ed6\u5355\u4f4d\u8f93\u51fa\u5185\u5b58\u7684\u4f7f\u7528\u91cf\uff0c\u9700\u8981\u52a0\u4e00\u4e2a\u9009\u9879\uff0c-g\u4e3aGB\uff0c-m\u4e3aMB\uff0c-k\u4e3aKB\uff0c-b\u4e3a\u5b57\u8282<\/p>\n<p>$\u00a0free\u00a0-g<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u67e5\u770b\u6240\u6709\u5185\u5b58\u7684\u6c47\u603b\uff0c\u8bf7\u4f7f\u7528-t\u9009\u9879\uff0c\u4f7f\u7528\u8fd9\u4e2a\u9009\u9879\u4f1a\u5728\u8f93\u51fa\u4e2d\u52a0\u4e00\u4e2a\u6c47\u603b\u884c<\/p>\n<p>$\u00a0free\u00a0-t<\/p>\n<p>24. top<\/p>\n<p>top\u547d\u4ee4\u4f1a\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u4e2d\u5360\u7528\u8d44\u6e90\u6700\u591a\u7684\u4e00\u4e9b\u8fdb\u7a0b\uff08\u9ed8\u8ba4\u4ee5CPU\u5360\u7528\u7387\u6392\u5e8f\uff09\u5982\u679c\u4f60\u60f3\u6539\u53d8\u6392\u5e8f\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5728\u7ed3\u679c\u5217\u8868\u4e2d\u70b9\u51fbO\uff08\u5927\u5199\u5b57\u6bcdO\uff09\u4f1a\u663e\u793a\u6240\u6709\u53ef\u7528\u4e8e\u6392\u5e8f\u7684\u5217\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f60\u5c31\u53ef\u4ee5\u9009\u62e9\u4f60\u60f3\u6392\u5e8f\u7684\u5217<\/p>\n<p>Current\u00a0Sort\u00a0Field:\u00a0\u00a0P\u00a0\u00a0for\u00a0window\u00a01:DefSelect\u00a0sort\u00a0field\u00a0via\u00a0field\u00a0letter,\u00a0type\u00a0any\u00a0other\u00a0key\u00a0to\u00a0return<\/p>\n<p>a:\u00a0PID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0Process\u00a0Id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0v:\u00a0nDRT\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0Dirty\u00a0Pages\u00a0count<\/p>\n<p>d:\u00a0UID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0User\u00a0Id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0y:\u00a0WCHAN\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0Sleeping\u00a0in\u00a0Function<\/p>\n<p>e:\u00a0USER\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0User\u00a0Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0z:\u00a0Flags\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0Task\u00a0Flags<\/p>\n<p>&#8230;&#8230;..<\/p>\n<p>\u5982\u679c\u53ea\u60f3\u663e\u793a\u67d0\u4e2a\u7279\u5b9a\u7528\u6237\u7684\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u4f7f\u7528-u\u9009\u9879<\/p>\n<p>$\u00a0top\u00a0-u\u00a0oracle<\/p>\n<p>25. df<\/p>\n<p>\u663e\u793a\u6587\u4ef6\u7cfb\u7edf\u7684\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0bdf -k \u5c06\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\u8f93\u51fa\u78c1\u76d8\u7684\u4f7f\u7528\u91cf<\/p>\n<p>$\u00a0df\u00a0-kFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01K-blocks\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Used\u00a0Available\u00a0Use%\u00a0Mounted\u00a0on\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a029530400\u00a0\u00a0\u00a03233104\u00a0\u00a024797232\u00a0\u00a012%\u00a0\/\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0120367992\u00a0\u00a050171596\u00a0\u00a064082060\u00a0\u00a044%\u00a0\/home<\/p>\n<p>\u4f7f\u7528-h\u9009\u9879\u53ef\u4ee5\u4ee5\u66f4\u7b26\u5408\u9605\u8bfb\u4e60\u60ef\u7684\u65b9\u5f0f\u663e\u793a\u78c1\u76d8\u4f7f\u7528\u91cf<\/p>\n<p>$\u00a0df\u00a0-hFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Size\u00a0\u00a0\u00a0Used\u00a0\u00a0Avail\u00a0Capacity\u00a0\u00a0iused\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ifree\u00a0%iused\u00a0\u00a0Mounted\u00a0on\/dev\/disk0s2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0232Gi\u00a0\u00a0\u00a084Gi\u00a0\u00a0148Gi\u00a0\u00a0\u00a0\u00a037%\u00a021998562\u00a0\u00a0\u00a038864868\u00a0\u00a0\u00a036%\u00a0\u00a0\u00a0\/devfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0187Ki\u00a0\u00a0187Ki\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0100%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0648\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0100%\u00a0\u00a0\u00a0\/dev<\/p>\n<p>map\u00a0-hosts\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0100%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0100%\u00a0\u00a0\u00a0\/net<\/p>\n<p>map\u00a0auto_home\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0\u00a00Bi\u00a0\u00a0\u00a0100%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0100%\u00a0\u00a0\u00a0\/home\/dev\/disk0s4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0466Gi\u00a0\u00a0\u00a045Gi\u00a0\u00a0421Gi\u00a0\u00a0\u00a0\u00a010%\u00a0\u00a0\u00a0112774\u00a0\u00a0440997174\u00a0\u00a0\u00a0\u00a00%\u00a0\u00a0\u00a0\/Volumes\/BOOTCAMP\/\/app@izenesoft.cn\/public\u00a0\u00a02.7Ti\u00a0\u00a01.3Ti\u00a0\u00a01.4Ti\u00a0\u00a0\u00a0\u00a048%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00\u00a018446744073709551615\u00a0\u00a0\u00a0\u00a00%\u00a0\u00a0\u00a0\/Volumes\/public<\/p>\n<p>\u4f7f\u7528-T\u9009\u9879\u663e\u793a\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b<\/p>\n<p>$\u00a0df\u00a0-TFilesystem\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a01K-blocks\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Used\u00a0Available\u00a0Use%\u00a0Mounted\u00a0on\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0\u00a029530400\u00a0\u00a0\u00a03233120\u00a0\u00a024797216\u00a0\u00a012%\u00a0\/\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0120367992\u00a0\u00a050171596\u00a0\u00a064082060\u00a0\u00a044%\u00a0\/home<\/p>\n<p>26. kill<\/p>\n<p>kill\u7528\u4e8e\u7ec8\u6b62\u4e00\u4e2a\u8fdb\u7a0b\u3002\u4e00\u822c\u6211\u4eec\u4f1a\u5148\u7528ps -ef\u67e5\u627e\u67d0\u4e2a\u8fdb\u7a0b\u5f97\u5230\u5b83\u7684\u8fdb\u7a0b\u53f7\uff0c\u7136\u540e\u518d\u4f7f\u7528kill -9 \u8fdb\u7a0b\u53f7\u7ec8\u6b62\u8be5\u8fdb\u7a0b\u3002\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528killall\u3001pkill\u3001xkill\u6765\u7ec8\u6b62\u8fdb\u7a0b<\/p>\n<p>$\u00a0ps\u00a0-ef\u00a0|\u00a0grep\u00a0vim<\/p>\n<p>ramesh\u00a0\u00a0\u00a0\u00a07243\u00a0\u00a07222\u00a0\u00a09\u00a022:43\u00a0pts\/2\u00a0\u00a0\u00a0\u00a000:00:00\u00a0vim<\/p>\n<p>$\u00a0kill\u00a0-9\u00a07243<\/p>\n<p>27. rm<\/p>\n<p>\u5220\u9664\u6587\u4ef6\u524d\u5148\u786e\u8ba4<\/p>\n<p>$\u00a0rm\u00a0-i\u00a0filename.txt<\/p>\n<p>\u5728\u6587\u4ef6\u540d\u4e2d\u4f7f\u7528shell\u7684\u5143\u5b57\u7b26\u4f1a\u975e\u5e38\u6709\u7528\u3002\u5220\u9664\u6587\u4ef6\u524d\u5148\u6253\u5370\u6587\u4ef6\u540d\u5e76\u8fdb\u884c\u786e\u8ba4<\/p>\n<p>$\u00a0rm\u00a0-i\u00a0file*<\/p>\n<p>\u9012\u5f52\u5220\u9664\u6587\u4ef6\u5939\u4e0b\u6240\u6709\u6587\u4ef6\uff0c\u5e76\u5220\u9664\u8be5\u6587\u4ef6\u5939<\/p>\n<p>$\u00a0rm\u00a0-r\u00a0example<\/p>\n<p>rm -rf \u5220\u9664\u6587\u4ef6\u5939\u5e76\u4e0d\u7528\u786e\u8ba4<\/p>\n<p>[root@test-2 tomcat]# rm -rf apache-tomcat-9.0.0.M18<\/p>\n<p>[root@test-2 tomcat]#<\/p>\n<p>28. cp<\/p>\n<p>\u62f7\u8d1d\u6587\u4ef61\u5230\u6587\u4ef62\uff0c\u5e76\u4fdd\u6301\u6587\u4ef6\u7684\u6743\u9650\u3001\u5c5e\u4e3b\u548c\u65f6\u95f4\u6233<\/p>\n<p>$\u00a0cp\u00a0-p\u00a0file1\u00a0file2<\/p>\n<p>\u62f7\u8d1dfile1\u5230file2\uff0c\u5982\u679cfile2\u5b58\u5728\u4f1a\u63d0\u793a\u662f\u5426\u8986\u76d6<\/p>\n<p>$\u00a0cp\u00a0-i\u00a0file1\u00a0file2<\/p>\n<p>29. mv<\/p>\n<p>\u5c06\u6587\u4ef6\u540dfile1\u91cd\u547d\u540d\u4e3afile2\uff0c\u5982\u679cfile2\u5b58\u5728\u5219\u63d0\u793a\u662f\u5426\u8986\u76d6<\/p>\n<p>$\u00a0mv\u00a0-i\u00a0file1\u00a0file2<\/p>\n<p>\u6ce8\u610f\u5982\u679c\u4f7f\u7528-f\u9009\u9879\u5219\u4e0d\u4f1a\u8fdb\u884c\u63d0\u793a<\/p>\n<p>-v\u4f1a\u8f93\u51fa\u91cd\u547d\u540d\u7684\u8fc7\u7a0b\uff0c\u5f53\u6587\u4ef6\u540d\u4e2d\u5305\u542b\u901a\u914d\u7b26\u65f6\uff0c\u8fd9\u4e2a\u9009\u9879\u4f1a\u975e\u5e38\u65b9\u4fbf<\/p>\n<p>$\u00a0mv\u00a0-v\u00a0file1\u00a0file2<\/p>\n<p>30. cat<\/p>\n<p>\u4f60\u53ef\u4ee5\u4e00\u6b21\u67e5\u770b\u591a\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u4e0b\u9762\u7684\u547d\u4ee4\u4f1a\u5148\u6253\u5370file1\u7684\u5185\u5bb9\uff0c\u7136\u540e\u6253\u5370file2\u7684\u5185\u5bb9<\/p>\n<p>$\u00a0cat\u00a0file1\u00a0file2<\/p>\n<p>-n\u547d\u4ee4\u53ef\u4ee5\u5728\u6bcf\u884c\u7684\u524d\u9762\u52a0\u4e0a\u884c\u53f7<\/p>\n<p>$\u00a0cat\u00a0-n\u00a0\/etc\/logrotate.conf\/var\/log\/btmp\u00a0{missingok3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0monthly4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0create\u00a00660\u00a0root\u00a0utmp5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0rotate\u00a016\u00a0}<\/p>\n<p>31. mount<\/p>\n<p>\u5982\u679c\u8981\u6302\u8f7d\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf\uff0c\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u7136\u540e\u5c06\u8fd9\u4e2a\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u5230\u8fd9\u4e2a\u76ee\u5f55\u4e0a<\/p>\n<p>#\u00a0mkdir\u00a0\/u01#\u00a0mount\u00a0\/dev\/sdb1\u00a0\/u01<\/p>\n<p>\u4e5f\u53ef\u4ee5\u628a\u5b83\u6dfb\u52a0\u5230fstab\u4e2d\u8fdb\u884c\u81ea\u52a8\u6302\u8f7d\uff0c\u8fd9\u6837\u4efb\u4f55\u65f6\u5019\u7cfb\u7edf\u91cd\u542f\u7684\u65f6\u5019\uff0c\u6587\u4ef6\u7cfb\u7edf\u90fd\u4f1a\u88ab\u52a0\u8f7d<\/p>\n<p>\/dev\/sdb1\u00a0\/u01\u00a0ext2\u00a0defaults\u00a00\u00a02<\/p>\n<p>32. chmod<\/p>\n<p>chmod\u7528\u4e8e\u6539\u53d8\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u6743\u9650<\/p>\n<p>\u7ed9\u6307\u5b9a\u6587\u4ef6\u7684\u5c5e\u4e3b\u548c\u5c5e\u7ec4\u6240\u6709\u6743\u9650(\u5305\u62ec\u8bfb\u3001\u5199\u3001\u6267\u884c)<\/p>\n<p>$\u00a0chmod\u00a0ug+rwx\u00a0file.txt<\/p>\n<p>\u5220\u9664\u6307\u5b9a\u6587\u4ef6\u7684\u5c5e\u7ec4\u7684\u6240\u6709\u6743\u9650<\/p>\n<p>$\u00a0chmod\u00a0g-rwx\u00a0file.txt<\/p>\n<p>\u4fee\u6539\u76ee\u5f55\u7684\u6743\u9650\uff0c\u4ee5\u53ca\u9012\u5f52\u4fee\u6539\u76ee\u5f55\u4e0b\u9762\u6240\u6709\u6587\u4ef6\u548c\u5b50\u76ee\u5f55\u7684\u6743\u9650<\/p>\n<p>$\u00a0chmod\u00a0-R\u00a0ug+rwx\u00a0file.txt<\/p>\n<p>33. chown<\/p>\n<p>chown\u7528\u4e8e\u6539\u53d8\u6587\u4ef6\u5c5e\u4e3b\u548c\u5c5e\u7ec4<\/p>\n<p>\u540c\u65f6\u5c06\u67d0\u4e2a\u6587\u4ef6\u7684\u5c5e\u4e3b\u6539\u4e3aoracle\uff0c\u5c5e\u7ec4\u6539\u4e3adb<\/p>\n<p>$\u00a0chown\u00a0oracle:dba\u00a0dbora.sh<\/p>\n<p>\u4f7f\u7528-R\u9009\u9879\u5bf9\u76ee\u5f55\u548c\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u8fdb\u884c\u9012\u5f52\u4fee\u6539<\/p>\n<p>$\u00a0chown\u00a0-R\u00a0oracle:dba\u00a0\/home\/oracle<\/p>\n<p>34. passwd<\/p>\n<p>passwd\u7528\u4e8e\u5728\u547d\u4ee4\u884c\u4fee\u6539\u5bc6\u7801\uff0c\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u8981\u6c42\u4f60\u5148\u8f93\u5165\u65e7\u5bc6\u7801\uff0c\u7136\u540e\u8f93\u5165\u65b0\u5bc6\u7801<\/p>\n<p>$\u00a0passwd<\/p>\n<p>\u8d85\u7ea7\u7528\u6237\u53ef\u4ee5\u7528\u8fd9\u4e2a\u547d\u4ee4\u4fee\u6539\u5176\u4ed6\u7528\u6237\u7684\u5bc6\u7801\uff0c\u8fd9\u4e2a\u65f6\u5019\u4e0d\u9700\u8981\u8f93\u5165\u7528\u6237\u7684\u5bc6\u7801<\/p>\n<p>#\u00a0passwd\u00a0USERNAME<\/p>\n<p>passwd\u8fd8\u53ef\u4ee5\u5220\u9664\u67d0\u4e2a\u7528\u6237\u7684\u5bc6\u7801\uff0c\u8fd9\u4e2a\u547d\u4ee4\u53ea\u6709root\u7528\u6237\u624d\u80fd\u64cd\u4f5c\uff0c\u5220\u9664\u5bc6\u7801\u540e\uff0c\u8fd9\u4e2a\u7528\u6237\u4e0d\u9700\u8981\u8f93\u5165\u5bc6\u7801\u5c31\u53ef\u4ee5\u767b\u5f55\u5230\u7cfb\u7edf<\/p>\n<p>#\u00a0passwd\u00a0-d\u00a0USERNAME<\/p>\n<p>35. mkdir<\/p>\n<p>\u5728home\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3atemp\u7684\u76ee\u5f55<\/p>\n<p>$\u00a0mkdir\u00a0~\/temp<\/p>\n<p>\u4f7f\u7528-p\u9009\u9879\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u8def\u5f84\u4e0a\u6240\u6709\u4e0d\u5b58\u5728\u7684\u76ee\u5f55<\/p>\n<p>$\u00a0mkdir\u00a0-p\u00a0dir1\/dir2\/dir3\/dir4\/<\/p>\n<p>36. ifconfig<\/p>\n<p>ifconfig\u7528\u4e8e\u67e5\u770b\u548c\u914d\u7f6eLinux\u7cfb\u7edf\u7684\u7f51\u7edc\u63a5\u53e3<\/p>\n<p>\u67e5\u770b\u6240\u6709\u7f51\u7edc\u63a5\u53e3\u53ca\u5176\u72b6\u6001<\/p>\n<p>$\u00a0ifconfig\u00a0-a<\/p>\n<p>\u4f7f\u7528up\u548cdown\u547d\u4ee4\u542f\u52a8\u6216\u505c\u6b62\u67d0\u4e2a\u63a5\u53e3<\/p>\n<p>$\u00a0ifconfig\u00a0eth0\u00a0up<\/p>\n<p>$\u00a0ifconfig\u00a0eth0\u00a0down<\/p>\n<p>37. uname<\/p>\n<p>uname\u53ef\u4ee5\u663e\u793a\u4e00\u4e9b\u91cd\u8981\u7684\u7cfb\u7edf\u4fe1\u606f\uff0c\u4f8b\u5982\u5185\u6838\u540d\u79f0\u3001\u4e3b\u673a\u540d\u3001\u5185\u6838\u7248\u672c\u53f7\u3001\u5904\u7406\u5668\u7c7b\u578b\u4e4b\u7c7b\u7684\u4fe1\u606f<\/p>\n<p>$ uname -a Linux john-laptop 2.6.32-24-generic #41-Ubuntu SMP Thu Aug 19 01:12:52 UTC 2010 i686 GNU\/Linux<\/p>\n<p>38. whereis<\/p>\n<p>\u5f53\u4f60\u4e0d\u77e5\u9053\u67d0\u4e2a\u547d\u4ee4\u7684\u4f4d\u7f6e\u65f6\u53ef\u4ee5\u4f7f\u7528whereis\u547d\u4ee4\uff0c\u4e0b\u9762\u4f7f\u7528whereis\u67e5\u627els\u7684\u4f4d\u7f6e<\/p>\n<p>$\u00a0whereis\u00a0ls<\/p>\n<p>ls:\u00a0\/bin\/ls\u00a0\/usr\/share\/man\/man1\/ls.1.gz\u00a0\/usr\/share\/man\/man1p\/ls.1p.gz<\/p>\n<p>\u5f53\u4f60\u60f3\u67e5\u627e\u67d0\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\uff0c\u4f46\u8fd9\u4e2a\u7a0b\u5e8f\u53c8\u4e0d\u5728whereis\u7684\u9ed8\u8ba4\u76ee\u5f55\u4e0b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528-B\u9009\u9879\uff0c\u5e76\u6307\u5b9a\u76ee\u5f55\u4f5c\u4e3a\u8fd9\u4e2a\u9009\u9879\u7684\u53c2\u6570\u3002\u4e0b\u9762\u7684\u547d\u4ee4\u5728\/tmp\u76ee\u5f55\u4e0b\u67e5\u627elsmk\u547d\u4ee4<\/p>\n<p>$\u00a0whereis\u00a0-u\u00a0-B\u00a0\/tmp\u00a0-f\u00a0lsmk<\/p>\n<p>lsmk:\u00a0\/tmp\/lsmk<\/p>\n<p>39. whatis<\/p>\n<p>wathis\u663e\u793a\u67d0\u4e2a\u547d\u4ee4\u7684\u63cf\u8ff0\u4fe1\u606f<\/p>\n<p>$\u00a0whatis\u00a0ls<\/p>\n<p>ls\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(1)\u00a0\u00a0&#8211;\u00a0list\u00a0directory\u00a0contents<\/p>\n<p>$\u00a0whatis\u00a0ifconfig<\/p>\n<p>ifconfig\u00a0(8)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8211;\u00a0configure\u00a0a\u00a0network\u00a0interface<\/p>\n<p>40. locate<\/p>\n<p>locate\u547d\u540d\u53ef\u4ee5\u663e\u793a\u67d0\u4e2a\u6307\u5b9a\u6587\u4ef6\uff08\u6216\u4e00\u7ec4\u6587\u4ef6\uff09\u7684\u8def\u5f84\uff0c\u5b83\u4f1a\u4f7f\u7528\u7531updatedb\u521b\u5efa\u7684\u6570\u636e\u5e93<\/p>\n<p>\u4e0b\u9762\u7684\u547d\u4ee4\u4f1a\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u5305\u542bcrontab\u5b57\u7b26\u4e32\u7684\u6587\u4ef6<\/p>\n<p>$\u00a0locate\u00a0crontab\/etc\/anacrontab\/etc\/crontab\/usr\/bin\/crontab\/usr\/share\/doc\/cron\/examples\/crontab2english.pl.gz\/usr\/share\/man\/man1\/crontab.1.gz\/usr\/share\/man\/man5\/anacrontab.5.gz\/usr\/share\/man\/man5\/crontab.5.gz\/usr\/share\/vim\/vim72\/syntax\/crontab.vim<\/p>\n<p>41. man<\/p>\n<p>\u663e\u793a\u67d0\u4e2a\u547d\u4ee4\u7684man\u9875\u9762<\/p>\n<p>$\u00a0man\u00a0crontab<\/p>\n<p>\u6709\u4e9b\u547d\u4ee4\u53ef\u80fd\u4f1a\u6709\u591a\u4e2aman\u9875\u9762\uff0c\u6bcf\u4e2aman\u9875\u9762\u5bf9\u5e94\u4e00\u79cd\u547d\u4ee4\u7c7b\u578b<\/p>\n<p>$\u00a0man\u00a0SECTION-NUMBER\u00a0commandname<\/p>\n<p>man\u9875\u9762\u4e00\u822c\u53ef\u4ee5\u5206\u4e3a8\u79cd\u547d\u4ee4\u7c7b\u578b<\/p>\n<ol type=\"1\">\n<li value=\"1\">\u7528\u6237\u547d\u4ee4<\/li>\n<li>\u7cfb\u7edf\u8c03\u7528<\/li>\n<li>c\u5e93\u51fd\u6570<\/li>\n<li>\u8bbe\u5907\u4e0e\u7f51\u7edc\u63a5\u53e3<\/li>\n<li>\u6587\u4ef6\u683c\u5f0f<\/li>\n<li>\u6e38\u620f\u4e0e\u5c4f\u4fdd<\/li>\n<li>\u73af\u5883\u3001\u8868\u3001\u5b8f<\/li>\n<li>\u7cfb\u7edf\u7ba1\u7406\u5458\u547d\u4ee4\u548c\u540e\u53f0\u8fd0\u884c\u547d\u4ee4<\/li>\n<\/ol>\n<p>\u4f8b\u5982\uff0c\u6211\u4eec\u6267\u884cwhatis crontab\uff0c\u4f60\u53ef\u4ee5\u770b\u5230crontab\u6709\u4e24\u4e2a\u547d\u4ee4\u7c7b\u578b1\u548c5\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770b\u547d\u4ee4\u7c7b\u578b5\u7684man\u9875\u9762<\/p>\n<p>$\u00a0whatis\u00a0crontab<\/p>\n<p>crontab\u00a0(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8211;\u00a0maintain\u00a0crontab\u00a0files\u00a0for\u00a0individual\u00a0users\u00a0(V3)crontab\u00a0(5)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8211;\u00a0tables\u00a0for\u00a0driving\u00a0cron<\/p>\n<p>$\u00a0man\u00a05\u00a0crontab<\/p>\n<p>42. tail<\/p>\n<p>tail\u547d\u4ee4\u9ed8\u8ba4\u663e\u793a\u6587\u4ef6\u6700\u540e\u768410\u884c\u6587\u672c<\/p>\n<p>$\u00a0tail\u00a0filename.txt<\/p>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528-n\u9009\u9879\u6307\u5b9a\u8981\u663e\u793a\u7684\u884c\u6570<\/p>\n<p>$\u00a0tail\u00a0-n\u00a0N\u00a0filename.txt<\/p>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528-f\u9009\u9879\u8fdb\u884c\u5b9e\u65f6\u67e5\u770b\uff0c\u8fd9\u4e2a\u547d\u4ee4\u6267\u884c\u540e\u4f1a\u7b49\u5f85\uff0c\u5982\u679c\u6709\u65b0\u884c\u6dfb\u52a0\u5230\u6587\u4ef6\u5c3e\u90e8\uff0c\u5b83\u4f1a\u7ee7\u7eed\u8f93\u51fa\u65b0\u7684\u884c\uff0c\u5728\u67e5\u770b\u65e5\u5fd7\u65f6\u8fd9\u4e2a\u9009\u9879\u4f1a\u975e\u5e38\u6709\u7528\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7CTRL-C\u7ec8\u6b62\u547d\u4ee4\u7684\u6267\u884c<\/p>\n<p>$\u00a0tail\u00a0-f\u00a0log-file<\/p>\n<p>43. less<\/p>\n<p>\u8fd9\u4e2a\u547d\u540d\u53ef\u4ee5\u5728\u4e0d\u52a0\u8f7d\u6574\u4e2a\u6587\u4ef6\u7684\u524d\u63d0\u4e0b\u663e\u793a\u6587\u4ef6\u5185\u5bb9\uff0c\u5728\u67e5\u770b\u5927\u578b\u65e5\u5fd7\u6587\u4ef6\u7684\u65f6\u5019\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u975e\u5e38\u6709\u7528<\/p>\n<p>$\u00a0less\u00a0huge-log-file.log<\/p>\n<p>\u5f53\u4f60\u7528less\u547d\u4ee4\u6253\u5f00\u67d0\u4e2a\u6587\u4ef6\u65f6\uff0c\u4e0b\u9762\u4e24\u4e2a\u6309\u952e\u4f1a\u7ed9\u4f60\u5e26\u6765\u5f88\u591a\u5e2e\u52a9\uff0c\u4ed6\u4eec\u7528\u4e8e\u5411\u524d\u548c\u5411\u540e\u6eda\u5c4f<\/p>\n<p>CTRL+F\u00a0\u2013\u00a0forward\u00a0one\u00a0window<\/p>\n<p>CTRL+B\u00a0\u2013\u00a0backward\u00a0one\u00a0window<\/p>\n<p>44. su<\/p>\n<p>su\u547d\u4ee4\u7528\u4e8e\u5207\u6362\u7528\u6237\u8d26\u53f7\uff0c\u8d85\u7ea7\u7528\u6237\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u5207\u6362\u5230\u4efb\u4f55\u5176\u4ed6\u7528\u6237\u800c\u4e0d\u7528\u8f93\u5165\u5bc6\u7801<\/p>\n<p>$\u00a0su\u00a0&#8211;\u00a0USERNAME<\/p>\n<p>\u7528\u53e6\u5916\u4e00\u4e2a\u7528\u6237\u540d\u6267\u884c\u4e00\u4e2a\u547d\u4ee4\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\u7528\u6237john\u4f7f\u7528raj\u7528\u6237\u540d\u6267\u884cls\u547d\u4ee4\uff0c\u6267\u884c\u5b8c\u540e\u8fd4\u56dejohn\u7684\u8d26\u53f7<\/p>\n<p>[john@dev-server]$\u00a0su\u00a0&#8211;\u00a0raj\u00a0-c\u00a0&#8216;ls'[john@dev-server]$<\/p>\n<p>\u7528\u6307\u5b9a\u7528\u6237\u767b\u5f55\uff0c\u5e76\u4e14\u4f7f\u7528\u6307\u5b9a\u7684shell\u7a0b\u5e8f\uff0c\u800c\u4e0d\u7528\u9ed8\u8ba4\u7684<\/p>\n<p>$\u00a0su\u00a0-s\u00a0&#8216;SHELLNAME&#8217;\u00a0USERNAME<\/p>\n<p>45. mysql<\/p>\n<p>mysql\u53ef\u80fd\u662fLinux\u4e0a\u4f7f\u7528\u6700\u5e7f\u6cdb\u7684\u6570\u636e\u5e93\uff0c\u5373\u4f7f\u4f60\u6ca1\u6709\u5728\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5mysql\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528mysql\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u8fdc\u7a0b\u7684mysql\u670d\u52a1\u5668<\/p>\n<p>\u8fde\u63a5\u4e00\u4e2a\u8fdc\u7a0b\u6570\u636e\u5e93\uff0c\u9700\u8981\u8f93\u5165\u5bc6\u7801<\/p>\n<p>$\u00a0mysql\u00a0-u\u00a0root\u00a0-p\u00a0-h\u00a0192.168.1.2<\/p>\n<p>\u8fde\u63a5\u672c\u5730\u6570\u636e\u5e93<\/p>\n<p>$\u00a0mysql\u00a0-u\u00a0root\u00a0-p<\/p>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u6570\u636e\u5e93\u5bc6\u7801\uff0c\u53ea\u9700\u8981\u5728-p\u540e\u9762\u52a0\u4e0a\u5bc6\u7801\u4f5c\u4e3a\u53c2\u6570\uff0c\u53ef\u4ee5\u76f4\u63a5\u5199\u5728p\u540e\u9762\u800c\u4e0d\u7528\u52a0\u7a7a\u683c<\/p>\n<p>46. yum<\/p>\n<p>\u4f7f\u7528yum\u5b89\u88c5apache<\/p>\n<p>$\u00a0yum\u00a0install\u00a0httpd<\/p>\n<p>\u66f4\u65b0apache<\/p>\n<p>$\u00a0yum\u00a0update\u00a0httpd<\/p>\n<p>\u5378\u8f7d\/\u5220\u9664apache<\/p>\n<p>$\u00a0yum\u00a0remove\u00a0httpd<\/p>\n<p>47. rpm<\/p>\n<p>\u4f7f\u7528rpm\u5b89\u88c5apache<\/p>\n<p>#\u00a0rpm\u00a0-ivh\u00a0httpd-2.2.3-22.0.1.el5.i386.rpm<\/p>\n<p>\u66f4\u65b0apache<\/p>\n<p>#\u00a0rpm\u00a0-uvh\u00a0httpd-2.2.3-22.0.1.el5.i386.rpm<\/p>\n<p>\u5378\u8f7d\/\u5220\u9664apache<\/p>\n<p>#\u00a0rpm\u00a0-ev\u00a0httpd<\/p>\n<p>48. ping<\/p>\n<p>ping\u4e00\u4e2a\u8fdc\u7a0b\u4e3b\u673a\uff0c\u53ea\u53d15\u4e2a\u6570\u636e\u5305<\/p>\n<p>$\u00a0ping\u00a0-c\u00a05\u00a0gmail.com<\/p>\n<p>49. date<\/p>\n<p>\u8bbe\u7f6e\u7cfb\u7edf\u65e5\u671f<\/p>\n<p>#\u00a0date\u00a0-s\u00a0&#8220;01\/31\/2010\u00a023:59:53&#8221;<\/p>\n<p>\u5f53\u4f60\u4fee\u6539\u4e86\u7cfb\u7edf\u65f6\u95f4\uff0c\u4f60\u9700\u8981\u540c\u6b65\u786c\u4ef6\u65f6\u95f4\u548c\u7cfb\u7edf\u65f6\u95f4<\/p>\n<p>#\u00a0hwclock\u00a0\u2013systohc#\u00a0hwclock\u00a0&#8211;systohc\u00a0\u2013utc<\/p>\n<p>50. wget<\/p>\n<p>\u4f7f\u7528wget\u4ece\u7f51\u4e0a\u4e0b\u8f7d\u8f6f\u4ef6\u3001\u97f3\u4e50\u3001\u89c6\u9891<\/p>\n<p>$\u00a0wget\u00a0<a href=\"http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nagios-3.2.1.tar.gz\">http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nagios-3.2.1.tar.gz<\/a><\/p>\n<p>\u4e0b\u8f7d\u6587\u4ef6\u5e76\u4ee5\u6307\u5b9a\u7684\u6587\u4ef6\u540d\u4fdd\u5b58\u6587\u4ef6<\/p>\n<p>$\u00a0wget\u00a0-O\u00a0taglist.zip\u00a0<a href=\"http:\/\/www.vim.org\/scripts\/download_script.php?src_id=7701\">http:\/\/www.vim.org\/scripts\/download_script.php?src_id=7701<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>0.\u67e5\u770blinux\u7248\u672c cat \/etc\/os-release 1. tar \u521b\u5efa\u4e00\u4e2a\u65b0\u7684tar\u6587\u4ef6 $\u00a0ta [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":490,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-941","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shellshell-scripts"],"_links":{"self":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=941"}],"version-history":[{"count":3,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/941\/revisions"}],"predecessor-version":[{"id":945,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/941\/revisions\/945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/media\/490"}],"wp:attachment":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}