{"id":265775,"date":"2023-03-01T14:08:59","date_gmt":"2023-03-01T06:08:59","guid":{"rendered":"https:\/\/lrxjmw.cn\/cxcylmldxxhz.html"},"modified":"2023-03-01T14:08:59","modified_gmt":"2023-03-01T06:08:59","slug":"cxcylmldxxhz","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/cxcylmldxxhz.html","title":{"rendered":"Centos\u4e0b\u5e38\u7528Linux\u547d\u4ee4\u7684\u5b66\u4e60\u5f88\u91cd\u8981"},"content":{"rendered":"

Centos\u4e0b\u5e38\u7528Linux<\/a>\u547d\u4ee4<\/a>\u7684\u5b66\u4e60find\u5f88\u91cd\u8981<\/p>\n

find\u547d\u4ee4\u62ff\u6765\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u67e5\u627e\u6587\u4ef6\u3002\u4efb\u4f55\u5750\u843d\u53c2\u6570\u4e4b\u524d\u7684\u5b57\u7b26\u4e32\u90fd\u5c06\u88ab\u89c6\u4e3a\u6b32\u67e5\u627e\u7684\u76ee\u5f55\u540d\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5047\u5982\u4e0d\u6307\u5b9a\u8def\u5f84\u540d\uff0c\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u8fdb\u884c\u67e5\u627e\u3002<\/p>\n

\u5728\/home\u76ee\u5f55\u4e0b\u67e5\u627e\u4ee5.txt\u7ed3\u5c3e\u7684\u6587\u4ef6\u540d<\/p>\n

\n

find \/home -name \"*.txt\"\n<\/code><\/pre>\n<\/p>\n

\u627e\u51fa\/home\u4e0b\u4e0d\u662f\u4ee5.txt\u7ed3\u5c3e\u7684\u6587\u4ef6<\/p>\n

\n

find \/home ! -name \"*.txt\"\n<\/code><\/pre>\n<\/p>\n

\u540c\u4e0a\uff0c\u4f46\u5ffd\u89c6\u5927\u5c0f\u5199<\/p>\n

\n

find \/home -iname \"*.txt\"\n<\/code><\/pre>\n<\/p>\n

\u5f53\u524d\u76ee\u5f55\u53ca\u5b50\u76ee\u5f55\u4e0b\u67e5\u627e\u6240\u6709\u4ee5.txt\u548c.pdf\u7ed3\u5c3e\u7684\u6587\u4ef6<\/p>\n

\n

find . -name \"*.txt\" -o -name \"*.pdf\"\n<\/code><\/pre>\n<\/p>\n

\u57fa\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u6587\u4ef6\u8def\u5f84<\/p>\n

\n

find . -regex \".*(.txt|.pdf)$\"\n<\/code><\/pre>\n<\/p>\n

\u4f9d\u7167\u6587\u4ef6\u7c7b\u578b\u8fdb\u884c\u641c\u7d22<\/p>\n

\n

find . -type \u7c7b\u578b\u53c2\u6570\n<\/code><\/pre>\n<\/p>\n

\n

\u7c7b\u578b\u53c2\u6570\u5217\u8868\uff1a\nf \u666e\u901a\u6587\u4ef6\nl \u7b26\u53f7\u8fde\u63a5\nd \u76ee\u5f55\nc \u5b57\u7b26\u8bbe\u5907\nb \u5757\u8bbe\u5907\ns \u5957\u63a5\u5b57\np Fifo\n<\/code><\/pre>\n<\/p>\n

\u4f9d\u7167\u6587\u4ef6\u65f6\u95f4\u6233\u8fdb\u884c\u641c\u7d22<\/p>\n

\n

find . -type f \u65f6\u95f4\u6233\n<\/code><\/pre>\n<\/p>\n

\n

UNIX\/Linux\u6587\u4ef6\u7cfb\u7edf\u6bcf\u4e2a\u6587\u4ef6\u90fd\u6709\u4e09\u79cd\u65f6\u95f4\u6233\uff1a\n\u8bbf\u95ee\u65f6\u95f4\uff08-atime\/\u5929\uff0c-amin\/\u5206\u949f\uff09\uff1a\u7528\u6237\u6700\u8fd1\u4e00\u6b21\u8bbf\u95ee\u65f6\u95f4\u3002\n\u4fee\u6539\u65f6\u95f4\uff08-mtime\/\u5929\uff0c-mmin\/\u5206\u949f\uff09\uff1a\u6587\u4ef6\u6700\u540e\u4e00\u6b21\u4fee\u6539\u65f6\u95f4\u3002\n\u53d8\u5316\u65f6\u95f4\uff08-ctime\/\u5929\uff0c-cmin\/\u5206\u949f\uff09\uff1a\u6587\u4ef6\u6570\u636e\u5143\uff08\u4f8b\u5982\u6743\u9650\u7b49\uff09\u6700\u540e\u4e00\u6b21\u4fee\u6539\u65f6\u95f4\u3002\n<\/code><\/pre>\n<\/p>\n

\u641c\u7d22\u8fd1\u6765\u4e09\u5929\u5185\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6<\/p>\n

\n

find . -type f -atime -7\n<\/code><\/pre>\n<\/p>\n

\u641c\u7d22\u6b63\u597d\u5728\u4e24\u5929\u524d\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6<\/p>\n

\n

find . type f -atime 7\n<\/code><\/pre>\n<\/p>\n

\u641c\u7d22\u8d85\u8fc7\u5341\u5929\u5185\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6<\/p>\n

\n

find . type f -atime +7\n<\/code><\/pre>\n<\/p>\n

\u641c\u7d22\u8bbf\u95ee\u65f6\u95f4\u8d85\u8fc710\u5206\u949f\u7684\u6240\u6709\u6587\u4ef6<\/p>\n

\n

find . type f -amin +7\n<\/code><\/pre>\n<\/p>\n

\u4f9d\u7167\u6587\u4ef6\u5927\u5c0f\u8fdb\u884c\u5339\u914d<\/p>\n

\n

find . -type f -size \u6587\u4ef6\u5927\u5c0f\u5355\u5143\n<\/code><\/pre>\n<\/p>\n

\n

\u6587\u4ef6\u5927\u5c0f\u5355\u5143\uff1a\nb \u2014\u2014 \u5757\uff08512\u5b57\u8282\uff09\nc \u2014\u2014 \u5b57\u8282\nw \u2014\u2014 \u5b57\uff082\u5b57\u8282\uff09\nk \u2014\u2014 \u5343\u5b57\u8282\nM \u2014\u2014 \u5146\u5b57\u8282\nG \u2014\u2014 \u5409\u5b57\u8282\n

linux\u4fee\u6539\u6587\u4ef6\u521b\u5efa\u65f6\u95f4_linux\u770b\u6587\u4ef6\u4fee\u6539\u65f6\u95f4_linux \u6587\u4ef6\u65f6\u95f4\u6233<\/p>\n<\/code><\/pre>\n<\/p>\n

\u641c\u7d22\u5c0f\u4e8e10KB\u7684\u6587\u4ef6<\/p>\n

\n

find . -type f -size +10\n<\/code><\/pre>\n<\/p>\n

\u641c\u7d22\u5927\u4e8e10KB\u7684\u6587\u4ef6<\/p>\n

\n

find . -type -f -size 10k \n<\/code><\/pre>\n<\/p>\n

\u5220\u6389\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709.txt\u6587\u4ef6<\/p>\n

\n

find . -type f -name \"*.txt\" -delete\n<\/code><\/pre>\n<\/p>\n

\u5f53\u524d\u76ee\u5f55\u4e0b\u641c\u7d22\u51fa\u6743\u9650\u4e3a777\u7684\u6587\u4ef6<\/p>\n

\n

find . -type f -perm 777\n<\/code><\/pre>\n<\/p>\n

\u627e\u51fa\u5f53\u524d\u76ee\u5f55\u4e0b\u6743\u9650\u4e0d\u662f644\u7684php\u6587\u4ef6<\/p>\n

\n

find . type f -name \"*.php\" ! -perm 644\n<\/code><\/pre>\n<\/p>\n

\u627e\u51fa\u5f53\u524d\u76ee\u5f55\u7528\u6237tom\u62e5\u6709\u7684\u6240\u6709\u6587\u4ef6<\/p>\n

\n

find . type f -user tom\n<\/code><\/pre>\n<\/p>\n

which<\/p>\n

which\u547d\u4ee4\u7528\u4e8e\u67e5\u627e\u5e76\u663e\u793a\u7ed9\u5b9a\u547d\u4ee4\u7684\u7edd\u5bf9\u8def\u5f84\u3002\u4f7f\u7528which\u547d\u4ee4\u4f1a\u53bb\u7cfb\u7edf<\/a>\u7684\u73af\u5883\u53d8\u91cfPATH\u4e2d\u53bb\u627e\u5bfb\u5bf9\u5e94\u7684\u547d\u4ee4\uff0c\u6765\u786e\u8ba4\u662f\u5426\u5b58\u5728\u4ee5\u53ca\u5176\u6267\u884c\u8def\u5f84\u662f\u54ea\u4e9b\u3002<\/p>\n

\n

[root@localhost ~]# which pwd\n\/bin\/pwd\n[root@localhost ~]#  which adduser\n\/usr\/sbin\/adduser\n<\/code><\/pre>\n<\/p>\n

whereis<\/p>\n

whereis\u547d\u4ee4\u53ea\u80fd\u7528\u4e8e\u7a0b\u5e8f\u540d\u7684\u641c\u7d22\uff0c\u5e76\u4e14\u53ea\u641c\u7d22\u4e8c\u8865\u7801\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<\/p>\n

\u548cfind\u76f8\u6bd4\uff0cwhereis\u67e5\u627e\u7684\u901f\u7387\u5341\u5206\u5feb\u3002\u7531\u4e8e\u5176\u67e5\u627e\u6587\u4ef6\u662f\u901a\u8fc7\u67e5\u8be2\u6570\u636e\u5e93\u6765\u5f97\u5230\u7684linux \u6587\u4ef6\u65f6\u95f4\u6233<\/strong>\uff0c\u800cfind\u662f\u901a\u8fc7\u786c\u789f\u68c0\u7d22\u800c\u5f97\u5230\u7684\u3002\u5e76\u4e14\u5176\u67e5\u5230\u7684\u6587\u4ef6\u53ef\u80fd\u662f\u4e0d\u5b58\u5728\u7684linux\u91cd\u542f\u547d\u4ee4\uff0c\u6216\u5219\u5b58\u5728\u5e76\u4e14\u627e\u4e0d\u5230\uff0c\u7531\u4e8eLinux\u7684\u6587\u4ef6\u6570\u636e\u5e93\u4e0d\u662f\u5b9e\u65f6\u66f4\u65b0\u7684\u3002\u9ed8\u8ba47\u5929\u66f4\u65b0\u4e00\u6b21<\/p>\n

\u5c06\u76f8\u5173\u7684\u6587\u4ef6\u90fd\u67e5\u627e\u4e0b\u6765<\/p>\n

\n

whereis Java\n<\/code><\/pre>\n<\/p>\n

cat<\/p>\n

cat\u547d\u4ee4\u8054\u63a5\u6587\u4ef6\u5e76\u590d\u5370\u5230\u6807\u51c6\u8f93\u51fa\u8bbe\u5907\u4e0a\uff0ccat\u65f6\u5e38\u62ff\u6765\u663e\u793a\u6587\u4ef6\u7684\u5185\u5bb9<\/p>\n

\u987b\u8981\u6ce8\u610f\u7684\u662f\uff1a\u5f53\u6587\u4ef6\u8f83\u5927\u65f6\uff0c\u6587\u672c\u5728\u5c4f\u5e55\u4e0a\u8fc5\u901f\u63a0\u8fc7\uff08\u6eda\u5c4f\uff09\uff0c\u7528\u6237\u5e38\u5e38\u770b\u4e0d\u6e05\u6240\u663e\u793a\u7684\u5185\u5bb9\u3002\u56e0\u800cqq for linux\uff0c\u901a\u5e38\u7528more\u7b49\u547d\u4ee4\u5206\u5c4f\u663e\u793a\u3002<\/p>\n

\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u6587\u4ef6ml\u7684\u5185\u5bb9\uff0c\u5e76\u663e\u793a\u884c\u53f7<\/p>\n

\n

cat -n m1\n<\/code><\/pre>\n<\/p>\n

\u540c\u65f6\u663e\u793a\u6587\u4ef6ml\u548cm2\u7684\u5185\u5bb9<\/p>\n

\n

cat m1 m2\n<\/code><\/pre>\n<\/p>\n

\u5c06\u6587\u4ef6ml\u548cm2\u5408\u5e76\u540e\u88c5\u5165\u6587\u4ef6file\u4e2d<\/p>\n

\n

cat m1 m2 > file \n<\/code><\/pre>\n<\/p>\n

\u6ce8\u610f\uff1a>\u901a\u5e38\u662f\u5199\u5165\u7684\u610f\u601d\u3002<\/p>\n

chmod<\/p>\n

chmod\u547d\u4ee4\u62ff\u6765\u53d8\u66f4\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6743\u9650\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6587\u4ef6\u6216\u76ee\u5f55\u6743\u9650\u7684\u63a7\u5236\u5206\u522b\u4ee5\u8bfb\u53d6\u3001\u5199\u5165\u3001\u6267\u884c3\u79cd\u901a\u5e38\u6743\u9650\u6765\u5206\u8fa8\u3002<\/p>\n

\n

\u6743\u9650\u8303\u56f4\u7684\u8868\u793a\u6cd5\u5982\u4e0b\uff1a\nu User\uff0c\u5373\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u62e5\u6709\u8005\uff1b\ng Group\uff0c\u5373\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6240\u5c5e\u7fa4\u7ec4\uff1b\no Other\uff0c\u9664\u4e86\u6587\u4ef6\u6216\u76ee\u5f55\u62e5\u6709\u8005\u6216\u6240\u5c5e\u7fa4\u7ec4\u4e4b\u5916\uff0c\u5176\u4ed6\u7528\u6237\u7686\u5c5e\u4e8e\u8fd9\u4e2a\u8303\u56f4\uff1b\na All\uff0c\u5373\u5168\u90e8\u7684\u7528\u6237\uff0c\u5305\u542b\u62e5\u6709\u8005\uff0c\u6240\u5c5e\u7fa4\u7ec4\u4ee5\u53ca\u5176\u4ed6\u7528\u6237\uff1b\nr \u8bfb\u53d6\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a\u201c4\u201d;\nw \u5199\u5165\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a\u201c2\u201d\uff1b\nx \u6267\u884c\u6216\u5207\u6362\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a\u201c1\u201d\uff1b\n- \u4e0d\u5177\u4efb\u4f55\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a\u201c0\u201d\uff1b\ns \u7279\u6b8a\u529f\u80fd\u8bf4\u660e\uff1a\u53d8\u66f4\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6743\u9650\u3002\n<\/code><\/pre>\n<\/p>\n

\u987b\u8981\u6ce8\u610f\u7684\u662f\uff1aLinux\u7528\u6237\u5206\u4e3a\uff1a\u62e5\u6709\u8005(User)\u3001\u7ec4\u7fa4(Group)\u3001\u5176\u4ed6\uff08other\uff09<\/p>\n

\u4e3a\u6587\u4ef6f01\u8bbe\u7f6e\u81ea\u5df1\u53ef\u4ee5\u6267\u884c\uff0c\u73ed\u59d4\u53ef\u4ee5\u5199<\/p>\n

linux \u6587\u4ef6\u65f6\u95f4\u6233_linux\u770b\u6587\u4ef6\u4fee\u6539\u65f6\u95f4_linux\u4fee\u6539\u6587\u4ef6\u521b\u5efa\u65f6\u95f4<\/p>\n

\n

chmod u+x,g+w f01\u3000\u3000\u5165\u7684\u6743\u9650\nchmod u=rwx,g=rw,o=r f01\nchmod 764 f01\n<\/code><\/pre>\n<\/p>\n

\u5bf9\u6587\u4ef6f01\u7684u,g,o\u90fd\u8bbe\u7f6e\u53ef\u6267\u884c\u5c5e\u6027<\/p>\n

\n

chmod a+x f01\n<\/code><\/pre>\n<\/p>\n

top<\/p>\n

top\u547d\u4ee4\u53ef\u4ee5\u5b9e\u65f6\u52a8\u6001\u5730\u67e5\u770b\u7cfb\u7edf\u7684\u6574\u4f53\u8fd0\u884c\u60c5\u51b5\uff0c\u662f\u4e00\u4e2a\u7efc\u5408\u4e86\u591a\u65b9\u4fe1\u606f\u68c0\u6d4b\u7cfb\u7edf\u6027\u80fd\u548c\u8fd0\u884c\u4fe1\u606f\u7684\u5b9e\u7528\u5de5\u5177\u3002<\/p>\n

\u5728top\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u4f7f\u7528\u7684\u4e00\u4e9b\u4ea4\u4e92\u547d\u4ee4\u3002\u8fd9\u79cd\u547d\u4ee4\u90fd\u662f\u5355\u5b57\u6bcd\u7684<\/p>\n

\n

h\uff1a\u663e\u793a\u5e2e\u52a9\u753b\u9762\uff0c\u7ed9\u51fa\u4e00\u4e9b\u7b80\u77ed\u7684\u547d\u4ee4\u603b\u7ed3\u8bf4\u660e\uff1b\nk\uff1a\u7ec8\u6b62\u4e00\u4e2a\u8fdb\u7a0b\uff1b\ni\uff1a\u5ffd\u7565\u95f2\u7f6e\u548c\u50f5\u6b7b\u8fdb\u7a0b\uff0c\u8fd9\u662f\u4e00\u4e2a\u5f00\u5173\u5f0f\u547d\u4ee4\uff1b\nq\uff1a\u9000\u51fa\u7a0b\u5e8f\uff1b\nr\uff1a\u91cd\u65b0\u5b89\u6392\u4e00\u4e2a\u8fdb\u7a0b\u7684\u4f18\u5148\u7ea7\u522b\uff1b\nS\uff1a\u5207\u6362\u5230\u7d2f\u8ba1\u6a21\u5f0f\uff1b\ns\uff1a\u6539\u53d8\u4e24\u6b21\u5237\u65b0\u4e4b\u95f4\u7684\u5ef6\u8fdf\u65f6\u95f4\uff08\u5355\u4f4d\u4e3as\uff09\uff0c\u5982\u679c\u6709\u5c0f\u6570\uff0c\u5c31\u6362\u7b97\u6210ms\u3002\u8f93\u51650\u503c\u5219\u7cfb\u7edf\u5c06\u4e0d\u65ad\u5237\u65b0\uff0c\u9ed8\u8ba4\u503c\u662f5s\uff1b\nf\u6216\u8005F\uff1a\u4ece\u5f53\u524d\u663e\u793a\u4e2d\u6dfb\u52a0\u6216\u8005\u5220\u9664\u9879\u76ee\uff1b\no\u6216\u8005O\uff1a\u6539\u53d8\u663e\u793a\u9879\u76ee\u7684\u987a\u5e8f\uff1b\nl\uff1a\u5207\u6362\u663e\u793a\u5e73\u5747\u8d1f\u8f7d\u548c\u542f\u52a8\u65f6\u95f4\u4fe1\u606f\uff1b\nm\uff1a\u5207\u6362\u663e\u793a\u5185\u5b58\u4fe1\u606f\uff1b\nt\uff1a\u5207\u6362\u663e\u793a\u8fdb\u7a0b\u548cCPU\u72b6\u6001\u4fe1\u606f\uff1b\nc\uff1a\u5207\u6362\u663e\u793a\u547d\u4ee4\u540d\u79f0\u548c\u5b8c\u6574\u547d\u4ee4\u884c\uff1b\nM\uff1a\u6839\u636e\u9a7b\u7559\u5185\u5b58\u5927\u5c0f\u8fdb\u884c\u6392\u5e8f\uff1b\nP\uff1a\u6839\u636eCPU\u4f7f\u7528\u767e\u5206\u6bd4\u5927\u5c0f\u8fdb\u884c\u6392\u5e8f\uff1b\nT\uff1a\u6839\u636e\u65f6\u95f4\/\u7d2f\u8ba1\u65f6\u95f4\u8fdb\u884c\u6392\u5e8f\uff1b\nw\uff1a\u5c06\u5f53\u524d\u8bbe\u7f6e\u5199\u5165~\/.toprc\u6587\u4ef6\u4e2d\u3002\n<\/code><\/pre>\n<\/p>\n

ps<\/p>\n

ps\u547d\u4ee4\u7528\u4e8e\u62a5\u544a\u5f53\u524d\u7cfb\u7edf\u7684\u8fdb\u7a0b\u72b6\u6001\u3002\u53ef\u4ee5\u642d\u914dkill\u6307\u4ee4\u968f\u65f6\u4e2d\u65ad\u3001\u5220\u9664\u6bcb\u987b\u8981\u7684\u7a0b\u5e8f\u3002ps\u547d\u4ee4\u662f\u6700\u57fa\u672c\u540c\u65f6\u4e5f\u662f\u5341\u5206\u5f3a\u608d\u7684\u8fdb\u7a0b\u67e5\u770b\u547d\u4ee4\uff0c\u4f7f\u7528\u8be5\u547d\u4ee4\u53ef\u4ee5\u786e\u5b9a\u6709\u4ec0\u4e48\u8fdb\u7a0b\u6b63\u5728\u8fd0\u884c\u548c\u8fd0\u884c\u7684\u72b6\u6001\u3001\u8fdb\u7a0b\u662f\u5426\u7ed3\u675f\u3001\u8fdb\u7a0b\u6709\u6ca1\u6709\u50f5\u6b7b\u3001\u54ea\u4e9b\u8fdb\u7a0b\u5360\u7528\u4e86\u8fc7\u591a\u7684\u8d44\u6e90\u7b49\u7b49\uff0c\u5176\u5b9e\u5927\u90e8\u4efd\u4fe1\u606f\u90fd\u662f\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u8be5\u547d\u4ee4\u5f97\u5230\u7684\u3002<\/p>\n

\u663e\u793a\u8fdb\u7a0b\u72b6\u6001<\/p>\n

\n

ps -aux\n<\/code><\/pre>\n<\/p>\n

tail<\/p>\n

tail\u547d\u4ee4\u7528\u4e8e\u8f93\u5165\u6587\u4ef6\u4e2d\u7684\u5c3e\u90e8\u5185\u5bb9\u3002tail\u547d\u4ee4\u9ed8\u8ba4\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u6307\u5b9a\u6587\u4ef6\u7684\u672b\u5c3e10\u884c\u3002<\/p>\n

\u987b\u8981\u6ce8\u610f\u7684\u662f\uff1a\u5047\u5982\u8868\u793a\u5b57\u8282\u6216\u884c\u6570\u7684N\u503c\u4e4b\u524d\u6709\u4e00\u4e2a\u201d+\u201d\u53f7\uff0c\u5219\u4ece\u6587\u4ef6\u5f00\u5934\u7684\u7b2cN\u9879\u5f00\u59cb\u663e\u793alinux \u6587\u4ef6\u65f6\u95f4\u6233<\/strong>\uff0c\u800c\u4e0d\u662f\u663e\u793a\u6587\u4ef6\u7684\u6700\u540eN\u9879\u3002<\/p>\n

\u663e\u793a\u6587\u4ef6file\u7684\u6700\u540e10\u884c<\/p>\n

\n

tail file\n<\/code><\/pre>\n<\/p>\n

\u663e\u793a\u6587\u4ef6file\u7684\u5185\u5bb9\uff0c\u4ece\u7b2c20\u884c\u81f3\u6587\u4ef6\u672b\u5c3e<\/p>\n

\n

tail +20 file \n<\/code><\/pre>\n<\/p>\n

echo<\/p>\n

echo\u547d\u4ee4\u7528\u4e8e\u5728shell\u4e2d\u590d\u5370shell\u53d8\u91cf\u7684\u503c\uff0c\u6216\u5219\u76f4\u63a5\u8f93\u51fa\u6307\u5b9a\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n

\u9009\u9879<\/p>\n

\n

-e\uff1a\u6fc0\u6d3b\u8f6c\u4e49\u5b57\u7b26\u3002\n<\/code><\/pre>\n<\/p>\n

\u4f7f\u7528-e\u9009\u9879\u65f6\uff0c\u82e5\u5b57\u7b26\u4e32\u4e2d\u51fa\u73b0\u4ee5\u4e0b\u5b57\u7b26\uff0c\u5219\u975e\u5e38\u52a0\u4ee5\u5904\u7406\uff0c\u800c\u4e0d\u4f1a\u5c06\u5b83\u5f53\u4f5c\u901a\u5e38\u6587\u5b57\u8f93\u51fa\uff1a<\/p>\n

\n

\na \u53d1\u51fa\u8b66\u544a\u58f0\uff1b\nb \u5220\u9664\u524d\u4e00\u4e2a\u5b57\u7b26\uff1b\nc \u6700\u540e\u4e0d\u52a0\u4e0a\u6362\u884c\u7b26\u53f7\uff1b\nf \u6362\u884c\u4f46\u5149\u6807\u4ecd\u65e7\u505c\u7559\u5728\u539f\u6765\u7684\u4f4d\u7f6e\uff1b\nn \u6362\u884c\u4e14\u5149\u6807\u79fb\u81f3\u884c\u9996\uff1b\nr \u5149\u6807\u79fb\u81f3\u884c\u9996\uff0c\u4f46\u4e0d\u6362\u884c\uff1b\nt \u63d2\u5165tab\uff1b\nv \u4e0ef\u76f8\u540c\uff1b\n\\ \u63d2\u5165\u5b57\u7b26\uff1b\nnnn \u63d2\u5165nnn\uff08\u516b\u8fdb\u5236\uff09\u6240\u4ee3\u8868\u7684ASCII\u5b57\u7b26\uff1b\n<\/code><\/pre>\n<\/p>\n

\u7528echo\u547d\u4ee4\u590d\u5370\u5e26\u6709\u8272\u8c03\u7684\u6587\u5b57\uff1a<\/p>\n

\n

echo -e \"e[1;31mI am hikarie[0m\"\n<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5982\u679c\u4e0d\u6307\u5b9a\u8def\u5f84\u540d\uff0c\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u8fdb\u884c\u67e5\u627e\u3002\u6839\u636e\u6587\u4ef6\u65f6\u95f4\u6233\u8fdb\u884c\u641c\u7d22\u641c\u7d22\u6700\u8fd1\u4e03\u5929\u5185\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6\u641c\u7d22\u6070\u597d\u5728\u4e03\u5929\u524d\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6\u641c\u7d22\u8d85\u8fc7\u4e03\u5929\u5185\u88ab\u8bbf\u95ee\u8fc7\u7684\u6240\u6709\u6587\u4ef6\u641c\u7d22\u8bbf\u95ee\u65f6\u95f4\u8d85\u8fc710\u5206\u949f\u7684\u6240\u6709\u6587\u4ef6\u4f46\u662f\u5176\u67e5\u5230\u7684\u6587\u4ef6\u53ef\u80fd\u662f\u4e0d\u5b58\u5728\u7684\uff0c\u6216\u8005\u5b58\u5728\u4f46\u662f\u627e\u4e0d\u5230\uff0c\u56e0\u4e3aLinux\u7684\u6587\u4ef6\u6570\u636e\u5e93\u4e0d\u662f\u5b9e\u65f6\u66f4\u65b0\u7684\u3002\u5728top\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u4f7f\u7528\u7684\u4e00\u4e9b\u4ea4\u4e92\u547d\u4ee4\u3002<\/p>\n","protected":false},"author":1,"featured_media":265776,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-265775","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/265775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=265775"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/265775\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/265776"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=265775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=265775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=265775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}