{"id":49451,"date":"2023-05-16T18:00:37","date_gmt":"2023-05-16T10:00:37","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=49451"},"modified":"2023-05-16T18:00:37","modified_gmt":"2023-05-16T10:00:37","slug":"file-processing-command","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/file-processing-command.html","title":{"rendered":"linux\u5165\u95e8\u5fc5\u5b66\u6587\u4ef6\u5904\u7406\u547d\u4ee4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nlinux\u5165\u95e8\u5f0f\u5fc5\u5b66\u7684\u6587\u4ef6\u5904\u7406\u547d\u4ee4\uff0c\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u4e2a\u547d\u4ee4file\uff0cmkdir\uff0cgrep\uff0cdd\uff0cfind\uff0cmv\u3002<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Linux\u7cfb\u7edf\u4fe1\u606f\u5b58\u653e\u5728\u6587\u4ef6\u91cc\uff0c\u6587\u4ef6\u4e0e\u666e\u901a\u7684\u516c\u52a1\u6587\u4ef6\u7c7b\u4f3c\u3002\u6bcf\u4e2a\u6587\u4ef6\u90fd\u6709\u81ea\u5df1\u7684\u540d\u5b57\u3001\u5185\u5bb9\u3001\u5b58\u653e\u5730\u5740\u53ca\u5176\u5b83\u4e00\u4e9b\u7ba1\u7406\u4fe1\u606f\uff0c\u5982\u6587\u4ef6\u7684\u7528\u6237\u3001\u6587\u4ef6\u7684\u5927\u5c0f\u7b49\u3002\u6587\u4ef6\u53ef\u4ee5\u662f\u4e00\u5c01\u4fe1\u3001\u4e00\u4e2a\u901a\u8baf\u5f55\uff0c\u6216\u8005\u662f\u7a0b\u5e8f\u7684\u6e90\u8bed\u53e5\u3001\u7a0b\u5e8f\u7684\u6570\u636e\uff0c\u751a\u81f3\u53ef\u4ee5\u5305\u62ec\u53ef\u6267\u884c\u7684\u7a0b\u5e8f\u548c\u5176\u5b83\u975e\u6b63\u6587\u5185\u5bb9\u3002Linux\u6587\u4ef6\u7cfb\u7edf\u5177\u6709\u826f\u597d\u7684\u7ed3\u6784\uff0c\u7cfb\u7edf\u63d0\u4f9b\u4e86\u5f88\u591a\u6587\u4ef6\u5904\u7406\u7a0b\u5e8f\u3002\u8fd9\u91cc\u4e3b\u8981\u4ecb\u7ecd\u5e38\u7528\u7684\u6587\u4ef6\u5904\u7406\u547d\u4ee4\u3002<\/p>\n

\"\"<\/p>\n

file<\/strong><\/div>\n
1.\u4f5c\u7528<\/strong><\/span><\/div>\n
file\u901a\u8fc7\u63a2\u6d4b\u6587\u4ef6\u5185\u5bb9\u5224\u65ad\u6587\u4ef6\u7c7b\u578b\uff0c\u4f7f\u7528\u6743\u9650\u662f\u6240\u6709\u7528\u6237\u3002<\/div>\n
2.\u683c\u5f0f<\/strong><\/span><\/div>\n
\n
file \u00a0[options] \u00a0\u6587\u4ef6\u540d<\/pre>\n<\/div>\n
3.[options]\u4e3b\u8981\u53c2\u6570<\/strong><\/span><\/div>\n
\n

-v\uff1a\u5728\u6807\u51c6\u8f93\u51fa\u540e\u663e\u793a\u7248\u672c\u4fe1\u606f\uff0c\u5e76\u4e14\u9000\u51fa\u3002<\/p>\n

-z\uff1a\u63a2\u6d4b\u538b\u7f29\u8fc7\u7684\u6587\u4ef6\u7c7b\u578b\u3002<\/p>\n

-L\uff1a\u5141\u8bb8\u7b26\u5408\u8fde\u63a5\u3002<\/p>\n<\/div>\n

4.\u7b80\u5355\u8bf4\u660e<\/strong><\/span><\/div>\n
\u4f7f\u7528file\u547d\u4ee4\u53ef\u4ee5\u77e5\u9053\u67d0\u4e2a\u6587\u4ef6\u7a76\u7adf\u662f\u4e8c\u8fdb\u5236\uff08ELF\u683c\u5f0f\uff09\u7684\u53ef\u6267\u884c\u6587\u4ef6,\u8fd8\u662fShell Script\u6587\u4ef6\uff0c\u6216\u8005\u662f\u5176\u5b83\u7684\u4ec0\u4e48\u683c\u5f0f\u3002file\u80fd\u8bc6\u522b\u7684\u6587\u4ef6\u7c7b\u578b\u6709\u76ee\u5f55\u3001Shell\u811a\u672c\u3001\u82f1\u6587\u6587\u672c\u3001\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u3001C\u8bed\u8a00\u6e90\u6587\u4ef6\u3001\u6587\u672c\u6587\u4ef6\u3001DOS\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/div>\n
5.\u5e94\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n
\n

\u5982\u679c\u6211\u4eec\u770b\u5230\u4e00\u4e2a\u6ca1\u6709\u540e\u7f00\u7684\u6587\u4ef6grap\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\uff1a<\/p>\n

$file grap\r\ngrap\uff1aEnglish text\r\n<\/pre>\n

\u6b64\u65f6\u7cfb\u7edf\u663e\u793a\u8fd9\u662f\u4e00\u4e2a\u82f1\u6587\u6587\u672c\u6587\u4ef6\u3002\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0cfile\u547d\u4ee4\u4e0d\u80fd\u63a2\u6d4b\u5305\u62ec\u56fe\u5f62\u3001\u97f3\u9891\u3001\u89c6\u9891\u7b49\u591a\u5a92\u4f53\u6587\u4ef6\u7c7b\u578b\u3002<\/p>\n<\/div>\n

mkdir<\/strong><\/div>\n
1.\u4f5c\u7528<\/strong><\/span><\/div>\n
mkdir\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u5efa\u7acb\u540d\u79f0\u4e3adirname\u7684\u5b50\u76ee\u5f55\uff0c\u4e0eMS DOS\u4e0b\u7684md\u547d\u4ee4\u7c7b\u4f3c\uff0c\u5b83\u7684\u4f7f\u7528\u6743\u9650\u662f\u6240\u6709\u7528\u6237<\/div>\n
2.\u683c\u5f0f<\/strong><\/span><\/div>\n
\n
mkdir [options] \u76ee\u5f55\u540d<\/pre>\n<\/div>\n
3.[options]\u4e3b\u8981\u53c2\u6570<\/strong><\/span><\/div>\n
\n

\uff0dm,\uff0d\uff0dmode=\u6a21\u5f0f\uff1a\u8bbe\u5b9a\u6743\u9650<\u6a21\u5f0f>;\uff0c\u4e0echmod\u7c7b\u4f3c\u3002<\/p>\n

\uff0dp,\uff0d\uff0dparents\uff1a\u9700\u8981\u65f6\u521b\u5efa\u4e0a\u5c42\u76ee\u5f55\uff1b\u5982\u679c\u76ee\u5f55\u65e9\u5df2\u5b58\u5728\uff0c\u5219\u4e0d\u5f53\u4f5c\u9519\u8bef\u3002<\/p>\n

\uff0dv,\uff0d\uff0dverbose\uff1a\u6bcf\u6b21\u521b\u5efa\u65b0\u76ee\u5f55\u90fd\u663e\u793a\u4fe1\u606f\u3002<\/p>\n

\uff0d\uff0dversion\uff1a\u663e\u793a\u7248\u672c\u4fe1\u606f\u540e\u79bb\u5f00\u3002<\/p>\n<\/div>\n

4.\u5e94\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n
\n

\u5728\u8fdb\u884c\u76ee\u5f55\u521b\u5efa\u65f6\u53ef\u4ee5\u8bbe\u7f6e\u76ee\u5f55\u7684\u6743\u9650\uff0c\u6b64\u65f6\u4f7f\u7528\u7684\u53c2\u6570\u662f\u201c\uff0dm\u201d\u3002\u5047\u8bbe\u8981\u521b\u5efa\u7684\u76ee\u5f55\u540d\u662f\u201ctsk\u201d\uff0c\u8ba9\u6240\u6709\u7528\u6237\u90fd\u6709rwx(\u5373\u8bfb\u3001\u5199\u3001\u6267\u884c\u7684\u6743\u9650)\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

$mkdir \uff0dm 777 tsk<\/pre>\n<\/div>\n
grep<\/strong><\/div>\n
1.\u4f5c\u7528<\/strong><\/span><\/div>\n
grep\u547d\u4ee4\u53ef\u4ee5\u6307\u5b9a\u6587\u4ef6\u4e2d\u641c\u7d22\u7279\u5b9a\u7684\u5185\u5bb9\uff0c\u5e76\u5c06\u542b\u6709\u8fd9\u4e9b\u5185\u5bb9\u7684\u884c\u6807\u51c6\u8f93\u51fa\u3002grep\u5168\u79f0\u662fGlobal Regular Expression Print\uff0c\u8868\u793a\u5168\u5c40\u6b63\u5219\u8868\u8fbe\u5f0f\u7248\u672c\uff0c\u5b83\u7684\u4f7f\u7528\u6743\u9650\u662f\u6240\u6709\u7528\u6237\u3002<\/div>\n
2.\u683c\u5f0f<\/strong><\/span><\/div>\n
grep\u00a0 [options]<\/pre>\n
3.[options]\u4e3b\u8981\u53c2\u6570<\/strong><\/span><\/div>\n
\n

\uff0dc\uff1a\u53ea\u8f93\u51fa\u5339\u914d\u884c\u7684\u8ba1\u6570\u3002<\/p>\n

\uff0dI\uff1a\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff08\u53ea\u9002\u7528\u4e8e\u5355\u5b57\u7b26\uff09\u3002<\/p>\n

\uff0dh\uff1a\u67e5\u8be2\u591a\u6587\u4ef6\u65f6\u4e0d\u663e\u793a\u6587\u4ef6\u540d\u3002<\/p>\n

\uff0dl\uff1a\u67e5\u8be2\u591a\u6587\u4ef6\u65f6\u53ea\u8f93\u51fa\u5305\u542b\u5339\u914d\u5b57\u7b26\u7684\u6587\u4ef6\u540d\u3002<\/p>\n

\uff0dn\uff1a\u663e\u793a\u5339\u914d\u884c\u53ca\u884c\u53f7\u3002<\/p>\n

\uff0ds\uff1a\u4e0d\u663e\u793a\u4e0d\u5b58\u5728\u6216\u65e0\u5339\u914d\u6587\u672c\u7684\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n

\uff0dv\uff1a\u663e\u793a\u4e0d\u5305\u542b\u5339\u914d\u6587\u672c\u7684\u6240\u6709\u884c\u3002<\/p>\n

pattern\u6b63\u5219\u8868\u8fbe\u5f0f\u4e3b\u8981\u53c2\u6570\uff1a<\/p>\n

\\\uff1a\u5ffd\u7565\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u7279\u6b8a\u5b57\u7b26\u7684\u539f\u6709\u542b\u4e49\u3002<\/p>\n

^\uff1a\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u884c\u3002<\/p>\n

$:\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u7ed3\u675f\u884c\u3002<\/p>\n

\\<\uff1a\u4ece\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u884c\u5f00\u59cb\u3002<\/p>\n

\\>;\uff1a\u5230\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u884c\u7ed3\u675f\u3002<\/p>\n

[]\uff1a\u5355\u4e2a\u5b57\u7b26\uff0c\u5982[A]\u5373A\u7b26\u5408\u8981\u6c42 \u3002<\/p>\n

[ - ]\uff1a\u8303\u56f4\uff0c\u5982[A-Z]\uff0c\u5373A\u3001B\u3001C\u4e00\u76f4\u5230Z\u90fd\u7b26\u5408\u8981\u6c42 \u3002<\/p>\n

*\uff1a\u6709\u5b57\u7b26\uff0c\u957f\u5ea6\u53ef\u4ee5\u4e3a0\u3002<\/p>\n

\u6b63\u5219\u8868\u8fbe\u5f0f\u662fLinux\/Unix\u7cfb\u7edf\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\u3002\u6b63\u5219\u8868\u8fbe\u5f0f\uff08\u4e5f\u79f0\u4e3a\u201cregex\u201d\u6216\u201cregexp\u201d\uff09\u662f\u4e00\u4e2a\u53ef\u4ee5\u63cf\u8ff0\u4e00\u7c7b\u5b57\u7b26\u4e32\u7684\u6a21\u5f0f\uff08Pattern\uff09\u3002\u5982\u679c\u4e00\u4e2a\u5b57\u7b26\u4e32\u53ef\u4ee5\u7528\u67d0\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u6765\u63cf\u8ff0\uff0c\u6211\u4eec\u5c31\u8bf4\u8fd9\u4e2a\u5b57\u7b26\u548c\u8be5\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\uff08Match\uff09\u3002\u8fd9\u548cDOS\u4e2d\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26\u201c*\u201d\u4ee3\u8868\u4efb\u610f\u5b57\u7b26\u7c7b\u4f3c\u3002\u5728Linux\u7cfb\u7edf\u4e0a\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u901a\u5e38\u88ab\u7528\u6765\u67e5\u627e\u6587\u672c\u7684\u6a21\u5f0f\uff0c\u4ee5\u53ca\u5bf9\u6587\u672c\u6267\u884c\u201c\u641c\u7d22\uff0d\u66ff\u6362\u201d\u64cd\u4f5c\u548c\u5176\u5b83\u529f\u80fd\u3002<\/p>\n<\/div>\n

4.\u5e94\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n
\n

\u67e5\u8be2DNS\u670d\u52a1\u662f\u65e5\u5e38\u5de5\u4f5c\u4e4b\u4e00\uff0c\u8fd9\u610f\u5473\u7740\u8981\u7ef4\u62a4\u8986\u76d6\u4e0d\u540c\u7f51\u7edc\u7684\u5927\u91cfIP\u5730\u5740\u3002\u6709\u65f6IP\u5730\u5740\u4f1a\u8d85\u8fc72000\u4e2a\u3002\u5982\u679c\u8981\u67e5\u770bnnn.nnn\u7f51\u7edc\u5730\u5740\uff0c\u4f46\u662f\u5374\u5fd8\u4e86\u7b2c\u4e8c\u90e8\u5206\u4e2d\u7684\u5176\u4f59\u90e8\u5206\uff0c\u53ea\u77e5\u5230\u6709\u4e24\u4e2a\u53e5\u70b9\uff0c\u4f8b\u5982nnn nn..\u3002\u8981\u62bd\u53d6\u5176\u4e2d\u6240\u6709nnn.nnn IP\u5730\u5740\uff0c\u4f7f\u7528[0\uff0d9 ]\\{3 \\}\\.[0\uff0d0\\{3\\}\\\u3002\u542b\u4e49\u662f\u4efb\u610f\u6570\u5b57\u51fa\u73b03\u6b21\uff0c\u540e\u8ddf\u53e5\u70b9\uff0c\u63a5\u7740\u662f\u4efb\u610f\u6570\u5b57\u51fa\u73b03\u6b21\uff0c\u540e\u8ddf\u53e5\u70b9\u3002<\/p>\n

$grep '[0\uff0d9 ]\\{3 \\}\\.[0\uff0d0\\{3\\}\\' ipfile<\/pre>\n

\u8865\u5145\u8bf4\u660e\uff0cgrep\u5bb6\u65cf\u8fd8\u5305\u62ecfgrep\u548cegrep\u3002fgrep\u662ffix grep\uff0c\u5141\u8bb8\u67e5\u627e\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u4e00\u4e2a\u6a21\u5f0f\uff1begrep\u662f\u6269\u5c55grep\uff0c\u652f\u6301\u57fa\u672c\u53ca\u6269\u5c55\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u4f46\u4e0d\u652f\u6301\\q\u6a21\u5f0f\u8303\u56f4\u7684\u5e94\u7528\u53ca\u4e0e\u4e4b\u76f8\u5bf9\u5e94\u7684\u4e00\u4e9b\u66f4\u52a0\u89c4\u8303\u7684\u6a21\u5f0f\u3002<\/p>\n<\/div>\n

dd<\/strong><\/div>\n
1.\u4f5c\u7528<\/strong><\/span><\/div>\n
dd\u547d\u4ee4\u7528\u6765\u590d\u5236\u6587\u4ef6\uff0c\u5e76\u6839\u636e\u53c2\u6570\u5c06\u6570\u636e\u8f6c\u6362\u548c\u683c\u5f0f\u5316\u3002<\/div>\n
2.\u683c\u5f0f<\/strong><\/span><\/div>\n
\n
dd\u00a0 [options]<\/pre>\n<\/div>\n
3.[options]\u4e3b\u8981\u53c2\u6570<\/strong><\/span><\/div>\n

bs=\u5b57\u8282\uff1a\u5f3a\u8febibs=<\u5b57\u8282>;\u53caobs=<\u5b57\u8282>;\u3002<\/p>\n

cbs=\u5b57\u8282\uff1a\u6bcf\u6b21\u8f6c\u6362\u6307\u5b9a\u7684<\u5b57\u8282>;\u3002<\/p>\n

conv=\u5173\u952e\u5b57\uff1a\u6839\u636e\u4ee5\u9017\u53f7\u5206\u9694\u7684\u5173\u952e\u5b57\u8868\u793a\u7684\u65b9\u5f0f\u6765\u8f6c\u6362\u6587\u4ef6\u3002<\/p>\n

count=\u5757\u6570\u76ee\uff1a\u53ea\u590d\u5236\u6307\u5b9a<\u5757\u6570\u76ee>;\u7684\u8f93\u5165\u6570\u636e\u3002<\/p>\n

ibs=\u5b57\u8282\uff1a\u6bcf\u6b21\u8bfb\u53d6\u6307\u5b9a\u7684<\u5b57\u8282>;\u3002<\/p>\n

if=\u6587\u4ef6\uff1a\u8bfb\u53d6<\u6587\u4ef6>;\u5185\u5bb9\uff0c\u800c\u975e\u6807\u51c6\u8f93\u5165\u7684\u6570\u636e\u3002<\/p>\n

obs=\u5b57\u8282\uff1a\u6bcf\u6b21\u5199\u5165\u6307\u5b9a\u7684<\u5b57\u8282>;\u3002<\/p>\n

of=\u6587\u4ef6\uff1a\u5c06\u6570\u636e\u5199\u5165<\u6587\u4ef6>;\uff0c\u800c\u4e0d\u5728\u6807\u51c6\u8f93\u51fa\u663e\u793a\u3002<\/p>\n

seek=\u5757\u6570\u76ee\uff1a\u5148\u7565\u8fc7\u4ee5obs\u4e3a\u5355\u4f4d\u7684\u6307\u5b9a<\u5757\u6570\u76ee>;\u7684\u8f93\u51fa\u6570\u636e\u3002<\/p>\n

skip=\u5757\u6570\u76ee\uff1a\u5148\u7565\u8fc7\u4ee5ibs\u4e3a\u5355\u4f4d\u7684\u6307\u5b9a<\u5757\u6570\u76ee>;\u7684\u8f93\u5165\u6570\u636e\u3002<\/p>\n

4.\u5e94\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n
\n

dd\u547d\u4ee4\u5e38\u5e38\u7528\u6765\u5236\u4f5cLinux\u542f\u52a8\u76d8\u3002\u5148\u627e\u4e00\u4e2a\u53ef\u5f15\u5bfc\u5185\u6838\uff0c\u4ee4\u5b83\u7684\u6839\u8bbe\u5907\u6307\u5411\u6b63\u786e\u7684\u6839\u5206\u533a\uff0c\u7136\u540e\u4f7f\u7528dd\u547d\u4ee4\u5c06\u5176\u5199\u5165\u8f6f\u76d8\uff1a<\/p>\n

$rdev vmlinuz \/dev\/hda\r\n$dd if\uff1dvmlinuz of\uff1d\/dev\/fd0<\/pre>\n

\u4e0a\u9762\u4ee3\u7801\u8bf4\u660e\uff0c\u4f7f\u7528rdev\u547d\u4ee4\u5c06\u53ef\u5f15\u5bfc\u5185\u6838vmlinuz\u4e2d\u7684\u6839\u8bbe\u5907\u6307\u5411\/dev\/hda\uff0c\u8bf7\u628a\u201chda\u201d\u6362\u6210\u81ea\u5df1\u7684\u6839\u5206\u533a\uff0c\u63a5\u4e0b\u6765\u7528dd\u547d\u4ee4\u5c06\u8be5\u5185\u6838\u5199\u5165\u8f6f\u76d8\u3002<\/p>\n

find<\/strong><\/div>\n
1.\u4f5c\u7528<\/strong><\/span><\/div>\n
find\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u5728\u76ee\u5f55\u4e2d\u641c\u7d22\u6587\u4ef6\uff0c\u5b83\u7684\u4f7f\u7528\u6743\u9650\u662f\u6240\u6709\u7528\u6237\u3002<\/div>\n
2.\u683c\u5f0f<\/strong><\/span><\/div>\n
\n
find\u00a0[path][options][expression]<\/pre>\n

path\u6307\u5b9a\u76ee\u5f55\u8def\u5f84\uff0c\u7cfb\u7edf\u4ece\u8fd9\u91cc\u5f00\u59cb\u6cbf\u7740\u76ee\u5f55\u6811\u5411\u4e0b\u67e5\u627e\u6587\u4ef6\u3002\u5b83\u662f\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u76f8\u4e92\u7528\u7a7a\u683c\u5206\u79bb\uff0c\u5982\u679c\u4e0d\u5199path\uff0c\u90a3\u4e48\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55\u3002<\/p>\n<\/div>\n

3.[options]\u4e3b\u8981\u53c2\u6570<\/strong><\/span><\/div>\n

\uff0ddepth\uff1a\u4f7f\u7528\u6df1\u5ea6\u7ea7\u522b\u7684\u67e5\u627e\u8fc7\u7a0b\u65b9\u5f0f\uff0c\u5728\u67d0\u5c42\u6307\u5b9a\u76ee\u5f55\u4e2d\u4f18\u5148\u67e5\u627e\u6587\u4ef6\u5185\u5bb9\u3002<\/p>\n

\uff0dmaxdepth levels\uff1a\u8868\u793a\u81f3\u591a\u67e5\u627e\u5230\u5f00\u59cb\u76ee\u5f55\u7684\u7b2clevel\u5c42\u5b50\u76ee\u5f55\u3002level\u662f\u4e00\u4e2a\u975e\u8d1f\u6570\uff0c\u5982\u679clevel\u662f0\u7684\u8bdd\u8868\u793a\u4ec5\u5728\u5f53\u524d\u76ee\u5f55\u4e2d\u67e5\u627e\u3002<\/p>\n

\uff0dmindepth levels\uff1a\u8868\u793a\u81f3\u5c11\u67e5\u627e\u5230\u5f00\u59cb\u76ee\u5f55\u7684\u7b2clevel\u5c42\u5b50\u76ee\u5f55\u3002<\/p>\n

\uff0dmount\uff1a\u4e0d\u5728\u5176\u5b83\u6587\u4ef6\u7cfb\u7edf\uff08\u5982Msdos\u3001Vfat\u7b49\uff09\u7684\u76ee\u5f55\u548c\u6587\u4ef6\u4e2d\u67e5\u627e\u3002<\/p>\n

\uff0dversion\uff1a\u6253\u5370\u7248\u672c\u3002<\/p>\n

[expression]\u662f\u5339\u914d\u8868\u8fbe\u5f0f\uff0c\u662ffind\u547d\u4ee4\u63a5\u53d7\u7684\u8868\u8fbe\u5f0f\uff0cfind\u547d\u4ee4\u7684\u6240\u6709\u64cd\u4f5c\u90fd\u662f\u9488\u5bf9\u8868\u8fbe\u5f0f\u7684\u3002\u5b83\u7684\u53c2\u6570\u975e\u5e38\u591a\uff0c\u8fd9\u91cc\u53ea\u4ecb\u7ecd\u4e00\u4e9b\u5e38\u7528\u7684\u53c2\u6570\u3002<\/p>\n

\uff0dname\uff1a\u652f\u6301\u7edf\u914d\u7b26*\u548c?\u3002<\/p>\n

\uff0datime n\uff1a\u641c\u7d22\u5728\u8fc7\u53bbn\u5929\u8bfb\u53d6\u8fc7\u7684\u6587\u4ef6\u3002<\/p>\n

\uff0dctime n\uff1a\u641c\u7d22\u5728\u8fc7\u53bbn\u5929\u4fee\u6539\u8fc7\u7684\u6587\u4ef6\u3002<\/p>\n

\uff0dgroup grpoupname\uff1a\u641c\u7d22\u6240\u6709\u7ec4\u4e3agrpoupname\u7684\u6587\u4ef6\u3002<\/p>\n

\uff0duser\u7528\u6237\u540d\uff1a\u641c\u7d22\u6240\u6709\u6587\u4ef6\u5c5e\u4e3b\u4e3a\u7528\u6237\u540d\uff08ID\u6216\u540d\u79f0\uff09\u7684\u6587\u4ef6\u3002<\/p>\n

\uff0dsize n\uff1a\u641c\u7d22\u6587\u4ef6\u5927\u5c0f\u662fn\u4e2ablock\u7684\u6587\u4ef6\u3002<\/p>\n

\uff0dprint\uff1a\u8f93\u51fa\u641c\u7d22\u7ed3\u679c\uff0c\u5e76\u4e14\u6253\u5370\u3002<\/p>\n

4.\u5e94\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n
\n

find\u547d\u4ee4\u67e5\u627e\u6587\u4ef6\u7684\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n

\uff081\uff09\u6839\u636e\u6587\u4ef6\u540d\u67e5\u627e<\/p>\n

\u4f8b\u5982\uff0c\u6211\u4eec\u60f3\u8981\u67e5\u627e\u4e00\u4e2a\u6587\u4ef6\u540d\u662flilo.conf\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

find \/ \uff0dname lilo.conf<\/pre>\n

find\u547d\u4ee4\u540e\u7684\u201c\/\u201d\u8868\u793a\u641c\u7d22\u6574\u4e2a\u786c\u76d8\u3002<\/p>\n

\uff082\uff09\u5feb\u901f\u67e5\u627e\u6587\u4ef6<\/p>\n

\u6839\u636e\u6587\u4ef6\u540d\u67e5\u627e\u6587\u4ef6\u4f1a\u9047\u5230\u4e00\u4e2a\u5b9e\u9645\u95ee\u9898\uff0c\u5c31\u662f\u8981\u82b1\u8d39\u76f8\u5f53\u957f\u7684\u4e00\u6bb5\u65f6\u95f4\uff0c\u7279\u522b\u662f\u5927\u578bLinux\u6587\u4ef6\u7cfb\u7edf\u548c\u5927\u5bb9\u91cf\u786c\u76d8\u6587\u4ef6\u653e\u5728\u5f88\u6df1\u7684\u5b50\u76ee\u5f55\u4e2d\u65f6\u3002\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e86\u8fd9\u4e2a\u6587\u4ef6\u5b58\u653e\u5728\u67d0\u4e2a\u76ee\u5f55\u4e2d\uff0c\u90a3\u4e48\u53ea\u8981\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u5f80\u4e0b\u5bfb\u627e\u5c31\u80fd\u8282\u7701\u5f88\u591a\u65f6\u95f4\u3002\u6bd4\u5982smb.conf\u6587\u4ef6\uff0c\u4ece\u5b83\u7684\u6587\u4ef6\u540e\u7f00\u201c.conf\u201d\u53ef\u4ee5\u5224\u65ad\u8fd9\u662f\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u5b83\u5e94\u8be5\u5728\/etc\u76ee\u5f55\u5185\uff0c\u6b64\u65f6\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\uff1a<\/p>\n

find \/etc \uff0dname smb.conf<\/pre>\n

\u8fd9\u6837\uff0c\u4f7f\u7528\u201c\u5feb\u901f\u67e5\u627e\u6587\u4ef6\u201d\u65b9\u5f0f\u53ef\u4ee5\u7f29\u77ed\u65f6\u95f4\u3002<\/p>\n

\uff083\uff09\u6839\u636e\u90e8\u5206\u6587\u4ef6\u540d\u67e5\u627e\u65b9\u6cd5<\/p>\n

\u6709\u65f6\u6211\u4eec\u77e5\u9053\u53ea\u67d0\u4e2a\u6587\u4ef6\u5305\u542b\u6709abvd\u8fd94\u4e2a\u5b57\uff0c\u90a3\u4e48\u8981\u67e5\u627e\u7cfb\u7edf\u4e2d\u6240\u6709\u5305\u542b\u6709\u8fd94\u4e2a\u5b57\u7b26\u7684\u6587\u4ef6\u53ef\u4ee5\u8f93\u5165\u4e0b\u9762\u547d\u4ee4\uff1a<\/p>\n

find \/ \uff0dname '*abvd*'<\/pre>\n

\u8f93\u5165\u8fd9\u4e2a\u547d\u4ee4\u4ee5\u540e\uff0cLinux\u7cfb\u7edf\u4f1a\u5c06\u5728\/\u76ee\u5f55\u4e2d\u67e5\u627e\u6240\u6709\u7684\u5305\u542b\u6709abvd\u8fd94\u4e2a\u5b57\u7b26\u7684\u6587\u4ef6\uff08\u5176\u4e2d*\u662f\u901a\u914d\u7b26\uff09\uff0c\u6bd4\u5982abvdrmyz\u7b49\u7b26\u5408\u6761\u4ef6\u7684\u6587\u4ef6\u90fd\u80fd\u663e\u793a\u51fa\u6765\u3002<\/p>\n

(4)\u4f7f\u7528\u6df7\u5408\u67e5\u627e\u65b9\u5f0f\u67e5\u627e\u6587\u4ef6<\/p>\n

find\u547d\u4ee4\u53ef\u4ee5\u4f7f\u7528\u6df7\u5408\u67e5\u627e\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\uff0c\u6211\u4eec\u60f3\u5728\/etc\u76ee\u5f55\u4e2d\u67e5\u627e\u5927\u4e8e500000\u5b57\u8282\uff0c\u5e76\u4e14\u572824\u5c0f\u65f6\u5185\u4fee\u6539\u7684\u67d0\u4e2a\u6587\u4ef6\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528-and (\u4e0e)\u628a\u4e24\u4e2a\u67e5\u627e\u53c2\u6570\u94fe\u63a5\u8d77\u6765\u7ec4\u5408\u6210\u4e00\u4e2a\u6df7\u5408\u7684\u67e5\u627e\u65b9\u5f0f\u3002<\/p>\n

find\u00a0 \/etc \u00a0-size +500000c -and -mtime +1<\/pre>\n
\n
mv<\/strong><\/div>\n
1.\u4f5c\u7528<\/strong><\/span><\/div>\n
mv\u547d\u4ee4\u7528\u6765\u4e3a\u6587\u4ef6\u6216\u76ee\u5f55\u6539\u540d\uff0c\u6216\u8005\u5c06\u6587\u4ef6\u7531\u4e00\u4e2a\u76ee\u5f55\u79fb\u5165\u53e6\u4e00\u4e2a\u76ee\u5f55\u4e2d\uff0c\u5b83\u7684\u4f7f\u7528\u6743\u9650\u662f\u6240\u6709\u7528\u6237\u3002\u8be5\u547d\u4ee4\u5982\u540cDOS\u547d\u4ee4\u4e2d\u7684ren\u548cmove\u7684\u7ec4\u5408\u3002<\/div>\n
2.\u683c\u5f0f<\/strong><\/span><\/div>\n
\n
mv \u00a0[options] \u00a0 \u6e90\u6587\u4ef6\u6216\u76ee\u5f55 \u00a0 \u76ee\u6807\u6587\u4ef6\u6216\u76ee\u5f55<\/pre>\n<\/div>\n
3.[options]\u4e3b\u8981\u53c2\u6570<\/strong><\/span><\/div>\n

\uff0di\uff1a\u4ea4\u4e92\u65b9\u5f0f\u64cd\u4f5c\u3002\u5982\u679cmv\u64cd\u4f5c\u5c06\u5bfc\u81f4\u5bf9\u5df2\u5b58\u5728\u7684\u76ee\u6807\u6587\u4ef6\u7684\u8986\u76d6\uff0c\u6b64\u65f6\u7cfb\u7edf\u8be2\u95ee\u662f\u5426\u91cd\u5199\uff0c\u8981\u6c42\u7528\u6237\u56de\u7b54\u201cy\u201d\u6216\u201cn\u201d\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u8bef\u8986\u76d6\u6587\u4ef6\u3002<\/p>\n

\uff0df\uff1a\u7981\u6b62\u4ea4\u4e92\u64cd\u4f5c\u3002mv\u64cd\u4f5c\u8981\u8986\u76d6\u67d0\u4e2a\u5df2\u6709\u7684\u76ee\u6807\u6587\u4ef6\u65f6\u4e0d\u7ed9\u4efb\u4f55\u6307\u793a\uff0c\u6307\u5b9a\u6b64\u53c2\u6570\u540ei\u53c2\u6570\u5c06\u4e0d\u518d\u8d77\u4f5c\u7528\u3002<\/p>\n

4.\u5e94\u7528\u5b9e\u4f8b<\/strong><\/span><\/div>\n
\n

\uff081\uff09\u5c06\/usr\/cbu\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u79fb\u5230\u5f53\u524d\u76ee\u5f55\uff08\u7528\u201c.\u201d\u8868\u793a\uff09\u4e2d\uff1a<\/p>\n

$mv \/usr\/cbu\/ * .<\/pre>\n

\uff082\uff09\u5c06\u6587\u4ef6cjh.txt\u91cd\u547d\u540d\u4e3awjz.txt\uff1a<\/p>\n

$mv cjh.txt wjz.txt<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.embeddedlinux.org.cn\/emb-linux\/entry-level\/201702\/09-6160.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/file-processing-command.html<\/a>\u7f16\u8f91\uff1a\u738b\u663e\u707f\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb linux\u5165\u95e8\u5f0f\u5fc5\u5b66\u7684\u6587\u4ef6\u5904\u7406\u547d\u4ee4\uff0c\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u4e2a\u547d\u4ee4file\uff0cmkdir\uff0cgrep\uff0cdd\uff0cfind\uff0cm […]<\/p>\n","protected":false},"author":402,"featured_media":49526,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-49451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/49451","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\/402"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=49451"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/49451\/revisions"}],"predecessor-version":[{"id":272345,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/49451\/revisions\/272345"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/49526"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=49451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=49451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=49451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}