{"id":291340,"date":"2024-05-03T22:57:57","date_gmt":"2024-05-03T14:57:57","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=291340"},"modified":"2024-07-10T12:30:16","modified_gmt":"2024-07-10T04:30:16","slug":"learing-linux-03","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/learing-linux-03.html","title":{"rendered":"\u7b2c3\u7ae0 \u7ba1\u9053\u7b26\u3001\u91cd\u5b9a\u5411\u4e0e\u73af\u5883\u53d8\u91cf"},"content":{"rendered":"

\u7ae0\u8282\u6982\u8ff0\uff1a<\/strong><\/span><\/p>\n

\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5df2\u7ecf\u5b66\u4e60\u4e8650\u591a\u4e2a\u5e38\u7528\u7684Linux\u7cfb\u7edf\u547d\u4ee4\uff0c\u5982\u679c\u4e0d\u80fd\u628a\u8fd9\u4e9b\u547d\u4ee4\u8fdb\u884c\u7ec4\u5408\u4f7f\u7528\uff0c\u4fbf\u96be\u4ee5\u4e8b\u534a\u529f\u500d\u5730\u63d0\u5347\u5de5\u4f5c\u6548\u7387\u3002\u672c\u7ae0\u9996\u5148\u8bb2\u89e3\u4e0e\u6587\u4ef6\u8bfb\u5199\u64cd\u4f5c\u6709\u5173\u7684\u91cd\u5b9a\u5411\u6280\u672f\u7684\u4e94\u79cd\u6a21\u5f0f\uff1a\u6807\u51c6\u8986\u76d6\u8f93\u51fa\u91cd\u5b9a\u5411\u3001\u6807\u51c6\u8ffd\u52a0\u8f93\u51fa\u91cd\u5b9a\u5411\u3001\u9519\u8bef\u8986\u76d6\u8f93\u51fa\u91cd\u5b9a\u5411\u3001\u9519\u8bef\u8ffd\u52a0\u8f93\u51fa\u91cd\u5b9a\u5411\u4ee5\u53ca\u8f93\u5165\u91cd\u5b9a\u5411\u3002\u901a\u8fc7\u5b9e\u9a8c\uff0c\u8bfb\u8005\u5c06\u5207\u5b9e\u7406\u89e3\u6bcf\u4e2a\u91cd\u5b9a\u5411\u6a21\u5f0f\u7684\u4f5c\u7528\uff0c\u89e3\u51b3\u8f93\u51fa\u4fe1\u606f\u7684\u4fdd\u5b58\u95ee\u9898\u3002<\/p>\n

\u6b64\u5916\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u8bb2\u89e3\u7ba1\u9053\u547d\u4ee4\u7b26\uff0c\u5e2e\u52a9\u8bfb\u8005\u638c\u63e1\u547d\u4ee4\u4e4b\u95f4\u7684\u642d\u914d\u4f7f\u7528\u65b9\u6cd5\uff0c\u8fdb\u4e00\u6b65\u63d0\u9ad8\u547d\u4ee4\u8f93\u51fa\u503c\u7684\u5904\u7406\u6548\u7387\u3002\u63a5\u4e0b\u6765\uff0c\u901a\u8fc7\u8bb2\u89e3Linux\u7cfb\u7edf\u547d\u4ee4\u884c\u4e2d\u7684\u901a\u914d\u7b26\u548c\u5e38\u7528\u8f6c\u4e49\u5b57\u7b26\uff0c\u8ba9\u60a8\u8f93\u5165\u7684Linux\u547d\u4ee4\u5177\u6709\u66f4\u51c6\u786e\u7684\u610f\u4e49\uff0c\u4e3a\u4e0b\u4e00\u7ae0\u5b66\u4e60\u7f16\u5199Shell\u811a\u672c\u6253\u597d\u57fa\u7840\u3002<\/p>\n

\u6700\u540e\uff0c\u672c\u7ae0\u8fdb\u4e00\u6b65\u5256\u6790\u4e86Bash\u89e3\u91ca\u5668\u6267\u884cLinux\u547d\u4ee4\u7684\u5185\u90e8\u539f\u7406\uff0c\u4e3a\u8bfb\u8005\u638c\u63e1PATH\u53d8\u91cf\u53caLinux\u7cfb\u7edf\u4e2d\u7684\u91cd\u8981\u73af\u5883\u53d8\u91cf\u5960\u5b9a\u4e86\u57fa\u7840\u3002<\/p>\n

3.1\u00a0\u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411<\/strong><\/span><\/h5>\n

\u65e2\u7136\u5df2\u7ecf\u5728\u4e0a\u4e00\u7ae0\u5b66\u5b8c\u4e86\u51e0\u4e4e\u6240\u6709\u57fa\u7840\u4e14\u5e38\u7528\u7684Linux\u547d\u4ee4\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u7684\u4efb\u52a1\u5c31\u662f\u628a\u591a\u4e2aLinux\u547d\u4ee4\u9002\u5f53\u5730\u7ec4\u5408\u5230\u4e00\u8d77\uff0c\u4f7f\u5176\u534f\u540c\u5de5\u4f5c\uff0c\u4ee5\u4fbf\u66f4\u9ad8\u6548\u5730\u5904\u7406\u6570\u636e\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u5c31\u5fc5\u987b\u641e\u660e\u767d\u547d\u4ee4\u7684\u8f93\u5165\u91cd\u5b9a\u5411\u548c\u8f93\u51fa\u91cd\u5b9a\u5411\u7684\u539f\u7406\u3002<\/p>\n

\u7b80\u8a00\u4e4b\uff0c\u8f93\u5165\u91cd\u5b9a\u5411\u662f\u6307\u5c06\u6587\u4ef6\u5185\u5bb9\u5bfc\u5165\u5230\u547d\u4ee4\u4e2d\uff0c\u800c\u8f93\u51fa\u91cd\u5b9a\u5411\u5219\u662f\u6307\u5c06\u539f\u672c\u8981\u8f93\u51fa\u5230\u5c4f\u5e55\u7684\u6570\u636e\u5199\u5165\u5230\u6307\u5b9a\u6587\u4ef6\u4e2d\uff0c\u6570\u636e\u6d41\u5411\u5982\u56fe3-1\u6240\u793a\u3002\u5728\u65e5\u5e38\u5b66\u4e60\u548c\u5de5\u4f5c\u4e2d\uff0c\u76f8\u8f83\u4e8e\u8f93\u5165\u91cd\u5b9a\u5411\uff0c\u8f93\u51fa\u91cd\u5b9a\u5411\u4f7f\u7528\u9891\u7387\u66f4\u9ad8\uff0c\u56e0\u6b64\u53c8\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5206\u4e3a\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u548c\u9519\u8bef\u8f93\u51fa\u91cd\u5b9a\u5411\u4e24\u79cd\u4e0d\u540c\u7684\u6280\u672f\uff0c\u4ee5\u53ca\u8986\u76d6\u5199\u5165\u4e0e\u8ffd\u52a0\u5199\u5165\u4e24\u79cd\u6a21\u5f0f\u3002\u542c\u8d77\u6765\u5f88\u7384\u5999\uff1f\u5218\u9044\u8001\u5e08\u5c06\u4e3a\u4f60\u6162\u6162\u9053\u6765\u3002<\/p>\n

\u6807\u51c6\u8f93\u5165\uff08STDIN\uff0c\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e3a0\uff09<\/strong>\uff1a\u9ed8\u8ba4\u4ece\u952e\u76d8\u8f93\u5165\uff0c\u4e5f\u53ef\u4ece\u5176\u4ed6\u6587\u4ef6\u6216\u547d\u4ee4\u4e2d\u8f93\u5165\u3002<\/p>\n

\u6807\u51c6\u8f93\u51fa\uff08STDOUT\uff0c\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e3a1\uff09<\/strong>\uff1a\u9ed8\u8ba4\u8f93\u51fa\u5230\u5c4f\u5e55\u3002<\/p>\n

\u9519\u8bef\u8f93\u51fa\uff08STDERR\uff0c\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e3a2\uff09<\/strong>\uff1a\u9ed8\u8ba4\u8f93\u51fa\u5230\u5c4f\u5e55\u3002<\/p><\/blockquote>\n

\"\"<\/p>\n

\u56fe3-1 \u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411\u793a\u610f\u56fe<\/p>\n

\u6bd4\u5982\u5206\u522b\u67e5\u770b\u4e24\u4e2a\u6587\u4ef6\u7684\u5c5e\u6027\u4fe1\u606f\uff0c\u6211\u4eec\u5148\u521b\u5efa\u51fa\u7b2c\u4e00\u4e2a\u6587\u4ef6\uff0c\u800c\u7b2c\u4e8c\u4e2a\u6587\u4ef6\u662f\u4e0d\u5b58\u5728\u7684\u3002\u6240\u4ee5\uff0c\u867d\u7136\u9488\u5bf9\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u64cd\u4f5c\u90fd\u5206\u522b\u4f1a\u5728\u5c4f\u5e55\u4e0a\u8f93\u51fa\u4e00\u4e9b\u4fe1\u606f\uff0c\u4f46\u8fd9\u4e24\u4e2a\u64cd\u4f5c\u7684\u5dee\u5f02\u5176\u5b9e\u5f88\u5927\uff1a<\/p>\n

\n
[root@linuxprobe ~]# touch linuxprobe\r\n[root@linuxprobe ~]# ls -l linuxprobe \r\n-rw-r--r--. 1 root root 0 May 8 23:54 linuxprobe\r\n[root@linuxprobe ~]# ls -l xxxxxx\r\nls: cannot access 'xxxxxx': No such file or directory\r\n<\/pre>\n

\u5728\u4e0a\u8ff0\u793a\u4f8b\u4e2d\uff0c\u540d\u4e3alinuxprobe\u7684\u6587\u4ef6\u662f\u771f\u5b9e\u5b58\u5728\u7684\uff0c\u8f93\u51fa\u4fe1\u606f\u662f\u8be5\u6587\u4ef6\u7684\u4e00\u4e9b\u76f8\u5173\u6743\u9650\u3001\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u3001\u6587\u4ef6\u5927\u5c0f\u53ca\u4fee\u6539\u65f6\u95f4\u7b49\u4fe1\u606f\uff0c\u8fd9\u4e5f\u662f\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4fe1\u606f\u3002\u800c\u540d\u4e3axxxxxx\u7684\u7b2c\u4e8c\u4e2a\u6587\u4ef6\u662f\u4e0d\u5b58\u5728\u7684\uff0c\u56e0\u6b64\u5728\u6267\u884c\u5b8cls\u547d\u4ee4\u4e4b\u540e\u663e\u793a\u7684\u62a5\u9519\u63d0\u793a\u4fe1\u606f\u4e5f\u662f\u8be5\u547d\u4ee4\u7684\u9519\u8bef\u8f93\u51fa\u4fe1\u606f\u3002\u90a3\u4e48\uff0c\u8981\u60f3\u628a\u539f\u672c\u8f93\u51fa\u5230\u5c4f\u5e55\u4e0a\u7684\u6570\u636e\u8f6c\u800c\u5199\u5165\u5230\u6587\u4ef6\u5f53\u4e2d\uff0c\u5c31\u8981\u533a\u522b\u5bf9\u5f85\u8fd9\u4e24\u79cd\u8f93\u51fa\u4fe1\u606f\u3002<\/p>\n

\u5bf9\u4e8e\u8f93\u5165\u91cd\u5b9a\u5411\u6765\u8bb2\uff0c\u7528\u5230\u7684\u7b26\u53f7\u53ca\u5176\u4f5c\u7528\u5982\u88683-1\u6240\u793a\u3002<\/p>\n

\u88683-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8f93\u5165\u91cd\u5b9a\u5411\u4e2d\u7528\u5230\u7684\u7b26\u53f7\u53ca\u5176\u4f5c\u7528<\/p>\n\n\n\n\n\n\n
\u7b26\u53f7<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
\u547d\u4ee4 < \u6587\u4ef6<\/td>\n\u5c06\u6587\u4ef6\u4f5c\u4e3a\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u5165<\/td>\n<\/tr>\n
\u547d\u4ee4 << \u5206\u754c\u7b26<\/td>\n\u4ece\u6807\u51c6\u8f93\u5165\u4e2d\u8bfb\u5165\uff0c\u76f4\u5230\u9047\u89c1\u5206\u754c\u7b26\u624d\u505c\u6b62<\/td>\n<\/tr>\n
\u547d\u4ee4 < \u6587\u4ef61 > \u6587\u4ef62<\/td>\n\u5c06\u6587\u4ef61\u4f5c\u4e3a\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u5165\u5e76\u5c06\u6807\u51c6\u8f93\u51fa\u5230\u6587\u4ef62<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5bf9\u4e8e\u8f93\u51fa\u91cd\u5b9a\u5411\u6765\u8bb2\uff0c\u7528\u5230\u7684\u7b26\u53f7\u53ca\u5176\u4f5c\u7528\u5982\u88683-2\u6240\u793a\u3002<\/p>\n

\u88683-2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8f93\u51fa\u91cd\u5b9a\u5411\u4e2d\u7528\u5230\u7684\u7b26\u53f7\u53ca\u5176\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n
\u7b26\u53f7<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
\u547d\u4ee4 > \u6587\u4ef6<\/td>\n\u5c06\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff08\u6e05\u7a7a\u539f\u6709\u6587\u4ef6\u7684\u6570\u636e\uff09<\/td>\n<\/tr>\n
\u547d\u4ee4 2> \u6587\u4ef6<\/td>\n\u5c06\u9519\u8bef\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff08\u6e05\u7a7a\u539f\u6709\u6587\u4ef6\u7684\u6570\u636e\uff09<\/td>\n<\/tr>\n
\u547d\u4ee4 >> \u6587\u4ef6<\/td>\n\u5c06\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff08\u8ffd\u52a0\u5230\u539f\u6709\u5185\u5bb9\u7684\u540e\u9762\uff09<\/td>\n<\/tr>\n
\u547d\u4ee4 2>> \u6587\u4ef6<\/td>\n\u5c06\u9519\u8bef\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff08\u8ffd\u52a0\u5230\u539f\u6709\u5185\u5bb9\u7684\u540e\u9762\uff09<\/td>\n<\/tr>\n
\u547d\u4ee4 >> \u6587\u4ef6 2>&1
\n\u6216
\n\u547d\u4ee4 &>> \u6587\u4ef6\n<\/td>\n
\u5c06\u6807\u51c6\u8f93\u51fa\u4e0e\u9519\u8bef\u8f93\u51fa\u5171\u540c\u5199\u5165\u5230\u6587\u4ef6\u4e2d\uff08\u8ffd\u52a0\u5230\u539f\u6709\u5185\u5bb9\u7684\u540e\u9762\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5bf9\u4e8e\u91cd\u5b9a\u5411\u4e2d\u7684\u6807\u51c6\u8f93\u51fa\u6a21\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6587\u4ef6\u63cf\u8ff0\u7b261\u4e0d\u5199\uff0c\u800c\u9519\u8bef\u8f93\u51fa\u6a21\u5f0f\u7684\u6587\u4ef6\u63cf\u8ff0\u7b262\u662f\u5fc5\u987b\u8981\u5199\u7684\u3002\u5148\u6765\u5c0f\u8bd5\u725b\u5200\u3002\u901a\u8fc7\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5c06man bash\u547d\u4ee4\u539f\u672c\u8981\u8f93\u51fa\u5230\u5c4f\u5e55\u7684\u4fe1\u606f\u5199\u5165\u5230\u6587\u4ef6readme.txt\u4e2d\uff0c\u7136\u540e\u663e\u793areadme.txt\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u3002\u5177\u4f53\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe ~]# man bash > readme.txt\r\n[root@linuxprobe ~]# cat readme.txt \r\nBASH(1)                       General Commands Manual                      BASH(1)\r\n\r\nNAME\r\n       bash - GNU Bourne-Again SHell\r\n\r\nSYNOPSIS\r\n       bash [options] [command_string | file]\r\n\r\nCOPYRIGHT\r\n       Bash is Copyright (C) 1989-2020 by the Free Software Foundation, Inc.\r\n\r\nDESCRIPTION\r\n       Bash  is  an  sh-compatible command language interpreter that executes com\u2010\r\n       mands read from the standard input or from a file.  Bash also  incorporates\r\n       useful features from the Korn and C shells (ksh and csh).\r\n\r\n       Bash  is intended to be a conformant implementation of the Shell and Utili\u2010\r\n       ties portion of the IEEE POSIX specification (IEEE Standard 1003.1).   Bash\r\n       can be configured to be POSIX-conformant by default.\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u6709\u6ca1\u6709\u611f\u89c9\u5230\u5f88\u65b9\u4fbf\u5462\uff1f\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u63a2\u7d22\u8f93\u51fa\u91cd\u5b9a\u5411\u4e2d\u7684\u8986\u76d6\u4e0e\u8ffd\u52a0\u5199\u5165\u4e24\u79cd\u6a21\u5f0f\uff0c\u4f53\u9a8c\u5b83\u4eec\u5404\u81ea\u5e26\u6765\u7684\u4e0d\u540c\u6548\u679c\u3002\u9996\u5148\u901a\u8fc7\u8986\u76d6\u5199\u5165\u6a21\u5f0f\u5411readme.txt\u6587\u4ef6\u5199\u5165\u591a\u884c\u6570\u636e\uff08\u8be5\u6587\u4ef6\u4e2d\u5df2\u5305\u542b\u4e0a\u4e00\u4e2a\u5b9e\u9a8c\u7684man\u547d\u4ee4\u4fe1\u606f\uff09\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u901a\u8fc7\u8986\u76d6\u5199\u5165\u6a21\u5f0f\u5411\u6587\u4ef6\u4e2d\u5199\u5165\u6570\u636e\u65f6\uff0c\u6bcf\u4e00\u6b21\u90fd\u4f1a\u8986\u76d6\u6389\u4e0a\u4e00\u6b21\u5199\u5165\u7684\u5185\u5bb9\uff0c\u6240\u4ee5\u6700\u7ec8\u6587\u4ef6\u4e2d\u53ea\u6709\u6700\u540e\u4e00\u6b21\u7684\u5199\u5165\u7ed3\u679c\uff1a<\/p>\n

[root@linuxprobe ~]# echo \"Welcome to lrxjmw.cn\" > readme.txt\r\n[root@linuxprobe ~]# echo \"Welcome to lrxjmw.cn\" > readme.txt\r\n[root@linuxprobe ~]# echo \"Welcome to lrxjmw.cn\" > readme.txt\r\n[root@linuxprobe ~]# echo \"Welcome to lrxjmw.cn\" > readme.txt\r\n[root@linuxprobe ~]# echo \"Welcome to lrxjmw.cn\" > readme.txt\r\n[root@linuxprobe ~]# cat readme.txt\r\nWelcome to lrxjmw.cn<\/pre>\n

\u518d\u901a\u8fc7\u8ffd\u52a0\u5199\u5165\u6a21\u5f0f\u5411readme.txt\u6587\u4ef6\u5199\u5165\u4e00\u6b21\u6570\u636e\uff0c\u7136\u540e\u5728\u6267\u884ccat\u547d\u4ee4\u4e4b\u540e\uff0c\u770b\u5230\u5982\u4e0b\u6240\u793a\u7684\u6587\u4ef6\u5185\u5bb9\uff1a<\/p>\n<\/div>\n

[root@linuxprobe ~]# echo \"Quality linux learning materials\" >> readme.txt\r\n[root@linuxprobe ~]# cat readme.txt\r\nWelcome to lrxjmw.cn\r\nQuality linux learning materials<\/pre>\n
\n

\u867d\u7136\u90fd\u662f\u8f93\u51fa\u91cd\u5b9a\u5411\u6280\u672f\uff0c\u4f46\u662f\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u548c\u9519\u8bef\u8f93\u51fa\u8fd8\u662f\u6709\u533a\u522b\u7684\u3002\u4f8b\u5982\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u4e2d\u67d0\u4e2a\u6587\u4ef6\u7684\u4fe1\u606f\uff0c\u8fd9\u91cc\u4ee5linuxprobe\u6587\u4ef6\u4e3a\u4f8b\u3002\u7531\u4e8e\u8fd9\u4e2a\u6587\u4ef6\u662f\u771f\u5b9e\u5b58\u5728\u7684\uff0c\u56e0\u6b64\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u5373\u53ef\u5c06\u539f\u672c\u8981\u8f93\u51fa\u5230\u5c4f\u5e55\u7684\u4fe1\u606f\u5199\u5165\u5230\u6587\u4ef6\u4e2d\uff0c\u800c\u9519\u8bef\u7684\u8f93\u51fa\u91cd\u5b9a\u5411\u5219\u4f9d\u7136\u628a\u4fe1\u606f\u8f93\u51fa\u5230\u4e86\u5c4f\u5e55\u4e0a\u3002<\/p>\n

[root@linuxprobe ~]# ls -l linuxprobe > \/root\/stderr.txt \r\n[root@linuxprobe ~]# ls -l linuxprobe 2> \/root\/stderr.txt \r\n-rw-r--r--. 1 root root 0 May 8 23:54 linuxprobe<\/pre>\n

\u5982\u679c\u60f3\u628a\u547d\u4ee4\u7684\u62a5\u9519\u4fe1\u606f\u5199\u5165\u5230\u6587\u4ef6\uff0c\u8be5\u600e\u4e48\u64cd\u4f5c\u5462\uff1f\u5f53\u7528\u6237\u5728\u6267\u884c\u4e00\u4e2a\u81ea\u52a8\u5316\u7684Shell\u811a\u672c\u65f6\uff0c\u8fd9\u4e2a\u64cd\u4f5c\u4f1a\u7279\u522b\u6709\u7528\uff0c\u800c\u4e14\u7279\u522b\u5b9e\u7528\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u628a\u6574\u4e2a\u811a\u672c\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u62a5\u9519\u4fe1\u606f\u90fd\u8bb0\u5f55\u5230\u6587\u4ef6\u4e2d\uff0c\u4fbf\u4e8e\u5b89\u88c5\u540e\u7684\u6545\u969c\u6392\u67e5\u5de5\u4f5c\u3002<\/p>\n

\u63a5\u4e0b\u6765\u4ee5\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u6587\u4ef6\u8fdb\u884c\u5b9e\u9a8c\u6f14\u793a\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l xxxxxx > \/root\/stderr.txt\r\nls: cannot access 'xxxxxx': No such file or directory\r\n[root@linuxprobe ~]# ls -l xxxxxx 2> \/root\/stderr.txt\r\n[root@linuxprobe ~]# cat \/root\/stderr.txt \r\nls: cannot access 'xxxxxx': No such file or directory<\/pre>\n

\u8fd8\u6709\u4e00\u79cd\u5e38\u89c1\u60c5\u51b5\uff0c\u5c31\u662f\u6211\u4eec\u60f3\u4e0d\u533a\u5206\u6807\u51c6\u8f93\u51fa\u548c\u9519\u8bef\u8f93\u51fa\uff0c\u53ea\u8981\u547d\u4ee4\u6709\u8f93\u51fa\u4fe1\u606f\u5219\u5168\u90e8\u8ffd\u52a0\u5199\u5165\u5230\u6587\u4ef6\u4e2d\u3002\u8fd9\u5c31\u8981\u7528\u5230&>>\u64cd\u4f5c\u7b26\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l linuxprobe &>> result.txt\r\n[root@linuxprobe ~]# ls -l xxxxxx &>> result.txt\r\n[root@linuxprobe ~]# cat readme.txt\r\n-rw-r--r--. 1 root root 0 May 8 23:54 linuxprobe\r\nls: cannot access 'xxxxxx': No such file or directory<\/pre>\n

\u8f93\u5165\u91cd\u5b9a\u5411\u76f8\u5bf9\u6765\u8bf4\u6709\u4e9b\u51b7\u95e8\uff0c\u5728\u5de5\u4f5c\u4e2d\u9047\u5230\u7684\u6982\u7387\u4f1a\u5c0f\u4e00\u70b9\u3002\u8f93\u5165\u91cd\u5b9a\u5411\u7684\u4f5c\u7528\u662f\u628a\u6587\u4ef6\u76f4\u63a5\u5bfc\u5165\u5230\u547d\u4ee4\u4e2d\u3002\u63a5\u4e0b\u6765\u4f7f\u7528\u8f93\u5165\u91cd\u5b9a\u5411\u628aresult.txt\u6587\u4ef6\u5bfc\u5165\u7ed9wc -l\u547d\u4ee4\uff0c\u7edf\u8ba1\u4e00\u4e0b\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u884c\u6570\uff1a<\/p>\n

[root@linuxprobe ~]# wc -l < readme.txt\r\n2<\/pre>\n<\/div>\n

\u5927\u5bb6\u5e94\u8be5\u53d1\u73b0\u8fd9\u6b21\u7684\u8f93\u51fa\u7ed3\u679c\u4e0e\u7b2c2\u7ae0\u8bb2\u7684\u65f6\u5019\u6709\u6240\u4e0d\u540c\uff1a\u6ca1\u6709\u4e86\u6587\u4ef6\u540d\u79f0\u3002<\/p>\n

[root@linuxprobe ~]# wc -l \/etc\/passwd\r\n37 \/etc\/passwd<\/pre>\n

\u8fd9\u662f\u56e0\u4e3a\u6b64\u524d\u4f7f\u7528\u7684\u201cwc -l \/etc\/passwd\u201d\u662f\u4e00\u79cd\u975e\u5e38\u6807\u51c6\u7684\u201c\u547d\u4ee4+\u53c2\u6570+\u5bf9\u8c61\u201d\u7684\u6267\u884c\u683c\u5f0f\uff0c\u800c\u8fd9\u6b21\u7684\u201cwc -l < result.txt\u201d\u5219\u662f\u5c06result.txt\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u901a\u8fc7\u64cd\u4f5c\u7b26\u5bfc\u5165\u5230\u547d\u4ee4\u4e2d\uff0c\u6ca1\u6709\u88ab\u5f53\u4f5c\u547d\u4ee4\u5bf9\u8c61\u8fdb\u884c\u6267\u884c\uff0c\u56e0\u6b64wc\u547d\u4ee4\u53ea\u80fd\u8bfb\u5230\u4fe1\u606f\u6d41\u6570\u636e\uff0c\u800c\u6ca1\u6709\u6587\u4ef6\u540d\u79f0\u7684\u4fe1\u606f\u3002\u8fd9\u4e2a\u5c0f\u5dee\u5f02\u540c\u5b66\u4eec\u53ef\u4ee5\u6162\u6162\u7422\u78e8\u4e0b\u3002<\/p>\n

3.2 \u7ba1\u9053\u547d\u4ee4\u7b26<\/strong><\/span><\/h5>\n

\u7ec6\u5fc3\u7684\u8bfb\u8005\u80af\u5b9a\u8fd8\u8bb0\u5f97\u57282.6\u8282\u5b66\u4e60tr\u547d\u4ee4\u65f6\u66fe\u7ecf\u89c1\u5230\u8fc7\u4e00\u4e2a\u540d\u4e3a\u7ba1\u9053\u7b26\u7684\u4e1c\u897f\u3002\u540c\u65f6\u6309\u4e0b\u952e\u76d8\u4e0a\u7684Shift\u952e\u548c\u53cd\u659c\u6760\uff08\\\uff09\u952e\u5373\u53ef\u8f93\u5165\u7ba1\u9053\u7b26\uff0c\u5176\u6267\u884c\u683c\u5f0f\u4e3a\u201c\u547d\u4ee4A | \u547d\u4ee4B\u201d\u3002\u7ba1\u9053\u547d\u4ee4\u7b26\u7684\u4f5c\u7528\u4e5f\u53ef\u4ee5\u7528\u4e00\u53e5\u8bdd\u6982\u62ec\u4e3a\u201c\u628a\u524d\u4e00\u4e2a\u547d\u4ee4\u539f\u672c\u8981\u8f93\u51fa\u5230\u5c4f\u5e55\u7684\u4fe1\u606f\u5f53\u4f5c\u540e\u4e00\u4e2a\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u5165<\/strong>\u201d\uff0c\u5982\u56fe3-2\u6240\u6240\u793a\uff1a<\/p>\n

\"\"<\/p>\n

\u56fe3-2 \u7ba1\u9053\u7b26\u793a\u610f\u56fe<\/p>\n

\u57282.6\u8282\u8bb2\u89e3grep\u6587\u672c\u641c\u7d22\u547d\u4ee4\u65f6\uff0c\u6211\u4eec\u901a\u8fc7\u5339\u914d\u5173\u952e\u8bcd\/sbin\/nologin\u627e\u51fa\u4e86\u6240\u6709\u88ab\u9650\u5236\u767b\u5f55\u7cfb\u7edf\u7684\u7528\u6237\u3002\u5728\u5b66\u5b8c\u672c\u8282\u5185\u5bb9\u540e\uff0c\u5b8c\u5168\u53ef\u4ee5\u628a\u4e0b\u9762\u8fd9\u4e24\u6761\u547d\u4ee4\u5408\u5e76\u4e3a\u4e00\u6761\uff1a<\/p>\n

\u627e\u51fa\u88ab\u9650\u5236\u767b\u5f55\u7528\u6237\u7684\u547d\u4ee4\u662fgrep \/sbin\/nologin \/etc\/passwd\uff1b<\/p>\n

\u7edf\u8ba1\u6587\u672c\u884c\u6570\u7684\u547d\u4ee4\u5219\u662fwc -l\u3002<\/p><\/blockquote>\n

\u73b0\u5728\u8981\u505a\u7684\u5c31\u662f\u628agrep\u641c\u7d22\u547d\u4ee4\u7684\u8f93\u51fa\u503c\u4f20\u9012\u7ed9wc\u7edf\u8ba1\u547d\u4ee4\uff0c\u5373\u628a\u539f\u672c\u8981\u8f93\u51fa\u5230\u5c4f\u5e55\u7684\u7528\u6237\u4fe1\u606f\u5217\u8868\u518d\u4ea4\u7ed9wc\u547d\u4ee4\u4f5c\u8fdb\u4e00\u6b65\u7684\u52a0\u5de5\uff0c\u56e0\u6b64\u53ea\u9700\u8981\u628a\u7ba1\u9053\u7b26\u653e\u5230\u4e24\u6761\u547d\u4ee4\u4e4b\u95f4\u5373\u53ef\uff0c\u5177\u4f53\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe ~]# grep \/sbin\/nologin \/etc\/passwd | wc -l\r\n32<\/pre>\n

\u8fd9\u7b80\u76f4\u662f\u592a\u65b9\u4fbf\u4e86\uff01\u8fd9\u4e2a\u7ba1\u9053\u7b26\u5c31\u50cf\u4e00\u4e2a\u6cd5\u5b9d\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5b83\u5957\u7528\u5230\u5176\u4ed6\u4e0d\u540c\u7684\u547d\u4ee4\u4e0a\uff0c\u6bd4\u5982\u7528\u7ffb\u9875\u7684\u5f62\u5f0f\u67e5\u770b\/etc\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5217\u8868\u53ca\u5c5e\u6027\u4fe1\u606f\uff08\u8fd9\u4e9b\u5185\u5bb9\u9ed8\u8ba4\u4f1a\u4e00\u80a1\u8111\u513f\u5730\u663e\u793a\u5230\u5c4f\u5e55\u4e0a\uff0c\u6839\u672c\u770b\u4e0d\u6e05\u695a\uff09\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l \/etc\/ | more\r\ntotal 1312\r\ndrwxr-xr-x.  3 root root        28 Sep 13  2024 accountsservice\r\n-rw-r--r--.  1 root root        16 Sep 13  2024 adjtime\r\n-rw-r--r--.  1 root root      1529 Jun 23  2024 aliases\r\ndrwxr-xr-x.  3 root root        65 Sep 13  2024 alsa\r\ndrwxr-xr-x.  2 root root      4096 Sep 13  2024 alternatives\r\n-rw-r--r--.  1 root root       541 Jul 11  2024 anacrontab\r\n-rw-r--r--.  1 root root       833 Aug 23  2024 appstream.conf\r\n-rw-r--r--.  1 root root        55 Feb 21  2024 asound.conf\r\n-rw-r--r--.  1 root root         1 Apr  4  2024 at.deny\r\ndrwxr-x---.  4 root root       100 Sep 13  2024 audit\r\n--More--\r\n<\/span><\/pre>\n

\u5728\u4fee\u6539\u7528\u6237\u5bc6\u7801\u65f6\uff0c\u901a\u5e38\u90fd\u9700\u8981\u8f93\u5165\u4e24\u6b21\u5bc6\u7801\u4ee5\u8fdb\u884c\u786e\u8ba4\uff0c\u8fd9\u5728\u7f16\u5199\u81ea\u52a8\u5316\u811a\u672c\u65f6\u5c06\u6210\u4e3a\u4e00\u4e2a\u975e\u5e38\u81f4\u547d\u7684\u7f3a\u9677\u3002\u901a\u8fc7\u628a\u7ba1\u9053\u7b26\u548cpasswd\u547d\u4ee4\u7684--stdin\u53c2\u6570\u76f8\u7ed3\u5408\uff0c\u53ef\u4ee5\u7528\u4e00\u6761\u547d\u4ee4\u6765\u5b8c\u6210\u5bc6\u7801\u91cd\u7f6e\u64cd\u4f5c\uff1a<\/p>\n

[root@linuxprobe ~]# echo \"linuxprobe\" | passwd --stdin root\r\nChanging password for user root.\r\npasswd: all authentication tokens updated successfully.<\/pre>\n

\u54b1\u4eec\u5728\u7b2c2\u7ae0\u5b66\u4e60ps\u547d\u4ee4\u7684\u65f6\u5019\uff0c\u8f93\u5165ps aux\u547d\u4ee4\u540e\u5c4f\u5e55\u4fe1\u606f\u547c\u547c\u95ea\u8fc7\uff0c\u6839\u672c\u627e\u4e0d\u5230\u6709\u7528\u7684\u4fe1\u606f\u3002\u73b0\u5728\uff0c\u6211\u4eec\u5c06ps\u3001grep\u4e0e\u7ba1\u9053\u7b26\u4e09\u8005\u5de7\u5999\u7ed3\u5408\uff0c\u53d1\u6325\u5404\u81ea\u7684\u957f\u5904\u3002\u4e0b\u9762\u53ea\u641c\u7d22\u4e0ebash\u6709\u5173\u7684\u8fdb\u7a0b\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# ps aux | grep bash\r\nroot        2689  0.0  0.2 224108  5716 pts\/0    Ss   19:48   0:00 bash\r\nroot        2893  0.0  0.1 221664  2296 pts\/0    S+   19:57   0:00 grep --color=auto bash\r\n<\/pre>\n

<\/p>\n

\u5927\u5bb6\u5343\u4e07\u4e0d\u8981\u8bef\u4ee5\u4e3a\u7ba1\u9053\u547d\u4ee4\u7b26\u53ea\u80fd\u5728\u4e00\u4e2a\u547d\u4ee4\u7ec4\u5408\u4e2d\u4f7f\u7528\u4e00\u6b21\u3002\u6211\u4eec\u5b8c\u5168\u53ef\u4ee5\u8fd9\u6837\u4f7f\u7528\uff1a\u201c\u547d\u4ee4A | \u547d\u4ee4B | \u547d\u4ee4C\u201d\u3002\u4e3a\u4e86\u5e2e\u52a9\u8bfb\u8005\u8fdb\u4e00\u6b65\u7406\u89e3\u7ba1\u9053\u7b26\u7684\u4f5c\u7528\uff0c\u5218\u9044\u8001\u5e08\u5728\u8bb2\u8bfe\u65f6\u7ecf\u5e38\u4f1a\u628a\u7ba1\u9053\u7b26\u63cf\u8ff0\u6210\u201c\u4efb\u610f\u95e8\u201d\u3002\u60f3\u5fc5\u5927\u5bb6\u5c0f\u65f6\u5019\u90fd\u770b\u8fc7\u201c\u54c6\u5566A\u68a6\u201d\u52a8\u753b\u7247\u5427\u3002\u54c6\u5566A\u68a6\uff08\u4e5f\u5c31\u662f\u5e38\u79f0\u7684\u673a\u5668\u732b\uff09\u7ecf\u5e38\u4e3a\u4e86\u53d6\u60a6\u5927\u96c4\u800c\u4ece\u53e3\u888b\u4e2d\u638f\u51fa\u4e00\u4ef6\u4ef6\u5b9d\u8d1d\uff0c\u5176\u4e2d\u597d\u591a\u6b21\u5c31\u7528\u5230\u4e86\u4efb\u610f\u95e8\u8fd9\u4e2a\u9053\u5177\u3002\u5176\u5b9e\uff0c\u7ba1\u9053\u7b26\u5c31\u597d\u50cf\u662f\u7528\u4e8e\u5b9e\u73b0\u6570\u636e\u7a7f\u8d8a\u7684\u4efb\u610f\u95e8\uff0c\u80fd\u591f\u5e2e\u52a9\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\uff0c\u5b8c\u6210\u4e4b\u524d\u4e0d\u6562\u60f3\u8c61\u7684\u590d\u6742\u5de5\u4f5c\u3002<\/p>\n

\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\u66fe\u7ecf\u6709\u4f4d\u4e1c\u5317\u7684\u540c\u5b66\u4e3e\u4e86\u4e00\u4e2a\u7279\u522b\u8d34\u5207\u7684\u6bd4\u55bb\uff1a\u628a\u7ba1\u9053\u7b26\u5f53\u4f5c\u6d41\u6c34\u7ebf\u4f5c\u4e1a\uff0c\u8fd9\u8ddf\u5403\u987f\u70e7\u70e4\u662f\u540c\u4e00\u4e2a\u9053\u7406\uff0c\u5373\u7b2c\u4e00\u4e2a\u4eba\u8d1f\u8d23\u5207\u8089\uff0c\u7b2c\u4e8c\u4e2a\u4eba\u8d1f\u8d23\u4e32\u8089\uff0c\u7b2c\u4e09\u4e2a\u4eba\u8d1f\u8d23\u70e7\u70e4\uff0c\u6700\u540e\u7684\u5904\u7406\u7ed3\u679c\u4ea4\u4ed8\u7ed9\u7528\u6237\u3002<\/div>\n<\/div>\n

\u5982\u679c\u8bfb\u8005\u662f\u4e00\u540dLinux\u65b0\u624b\uff0c\u53ef\u80fd\u4f1a\u89c9\u5f97\u4e0a\u9762\u7684\u547d\u4ee4\u7ec4\u5408\u5df2\u7ecf\u5341\u5206\u590d\u6742\u4e86\uff0c\u4f46\u662f\u6709\u8fc7\u8fd0\u7ef4\u7ecf\u9a8c\u7684\u8bfb\u8005\u53c8\u4f1a\u611f\u89c9\u5982\u9694\u9774\u6320\u75d2\u822c\u4e0d\u8fc7\u763e\uff0c\u4ed6\u4eec\u5e0c\u671b\u80fd\u5c06\u8fd9\u6837\u65b9\u4fbf\u7684\u547d\u4ee4\u5199\u5f97\u66f4\u9ad8\u7ea7\u4e00\u4e9b\uff0c\u529f\u80fd\u66f4\u5f3a\u5927\u4e00\u4e9b\u3002\u4e3a\u4e86\u611f\u8c22\u5404\u4f4d\u8bfb\u8005\u7684\u6367\u573a\u548c\u5bf9\u672c\u4e66\u7684\u8ba4\u53ef\uff0c\u5f53\u7136\u8981\u4e49\u4e0d\u5bb9\u8f9e\u5730\u628a\u6280\u672f\u62f1\u624b\u5949\u4e0a\u3002\u5982\u679c\u9700\u8981\u5c06\u7ba1\u9053\u7b26\u5904\u7406\u540e\u7684\u7ed3\u679c\u65e2\u8f93\u51fa\u5230\u5c4f\u5e55\uff0c\u53c8\u540c\u65f6\u5199\u5165\u5230\u6587\u4ef6\u4e2d\uff0c\u5219\u53ef\u4ee5\u4e0etee\u547d\u4ee4\u7ed3\u5408\u4f7f\u7528\u3002<\/p>\n

\u4e0b\u8ff0\u547d\u4ee4\u5c06\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u4e0ebash\u76f8\u5173\u7684\u8fdb\u7a0b\u4fe1\u606f\uff0c\u5e76\u540c\u65f6\u5c06\u8f93\u51fa\u5230\u5c4f\u5e55\u548c\u6587\u4ef6\u4e2d\uff1a<\/p>\n

\"\"<\/span><\/p>\n

[root@linuxprobe ~]# ps aux | grep bash | tee result.txt\r\nroot        2689  0.0  0.2 224108  5716 pts\/0    Ss   19:48   0:00 bash\r\nroot        2902  0.0  0.1 221664  2292 pts\/0    S+   19:59   0:00 grep --color=auto bash\r\n[root@linuxprobe ~]# cat result.txt\r\nroot        2689  0.0  0.2 224108  5716 pts\/0    Ss   19:48   0:00 bash\r\nroot        2902  0.0  0.1 221664  2292 pts\/0    S+   19:59   0:00 grep --color=auto bash\r\n<\/pre>\n
\n
3.3\u00a0\u547d\u4ee4\u884c\u7684\u901a\u914d\u7b26<\/span><\/strong><\/h5>\n

\u5927\u5bb6\u53ef\u80fd\u90fd\u9047\u5230\u8fc7\u63d0\u7b14\u5fd8\u5b57\u7684\u5c34\u5c2c\uff0c\u4f5c\u4e3aLinux\u8fd0\u7ef4\u4eba\u5458\uff0c\u6211\u4eec\u6709\u65f6\u5019\u4e5f\u4f1a\u9047\u5230\u660e\u660e\u4e00\u4e2a\u6587\u4ef6\u7684\u540d\u79f0\u5c31\u5728\u5634\u8fb9\u4f46\u5c31\u662f\u60f3\u4e0d\u8d77\u6765\u7684\u60c5\u51b5\u3002\u5982\u679c\u53ea\u8bb0\u5f97\u4e00\u4e2a\u6587\u4ef6\u7684\u5f00\u5934\u51e0\u4e2a\u5b57\u6bcd\uff0c\u60f3\u904d\u5386\u67e5\u627e\u51fa\u6240\u6709\u4ee5\u8fd9\u51e0\u4e2a\u5b57\u6bcd\u5f00\u5934\u7684\u6587\u4ef6\uff0c\u8be5\u600e\u4e48\u64cd\u4f5c\u5462\uff1f\u53c8\u6bd4\u5982\uff0c\u5047\u8bbe\u60f3\u8981\u6279\u91cf\u67e5\u770b\u6240\u6709\u786c\u76d8\u6587\u4ef6\u7684\u76f8\u5173\u6743\u9650\u5c5e\u6027\uff0c\u6709\u4e00\u79cd\u5b9e\u73b0\u65b9\u5f0f\u662f\u4e0b\u9762\u8fd9\u6837\u7684\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l \/dev\/sda\r\nbrw-rw----. 1 root disk 8, 0 Sep 13  2024 \/dev\/sda\r\n[root@linuxprobe ~]# ls -l \/dev\/sda1\r\nbrw-rw----. 1 root disk 8, 1 Sep 13  2024 \/dev\/sda1\r\n[root@linuxprobe ~]# ls -l \/dev\/sda2\r\nbrw-rw----. 1 root disk 8, 2 Sep 13  2024 \/dev\/sda2\r\n[root@linuxprobe ~]# ls -l \/dev\/sda3\r\nls: cannot access '\/dev\/sda3': No such file or directory\r\n<\/pre>\n

\u5e78\u597d\u6211\u7684\u786c\u76d8\u6587\u4ef6\u548c\u5206\u533a\u53ea\u67093\u4e2a\uff0c\u8981\u662f\u6709\u51e0\u767e\u4e2a\uff0c\u4f30\u8ba1\u9700\u8981\u82b1\u8d39\u4e00\u5929\u7684\u65f6\u95f4\u6765\u5fd9\u8fd9\u4e2a\u4e8b\u60c5\u4e86\u3002\u6240\u4ee5\uff0c\u8fd9\u79cd\u65b9\u5f0f\u7684\u6548\u7387\u786e\u5b9e\u5f88\u4f4e\u3002<\/p>\n

\u867d\u7136\u7b2c6\u7ae0\u624d\u4f1a\u8bb2\u89e3Linux\u7cfb\u7edf\u7684\u5b58\u50a8\u7ed3\u6784\u548cFHS\uff0c\u4f46\u73b0\u5728\u5e94\u8be5\u80fd\u770b\u51fa\u4e00\u4e9b\u7b80\u5355\u89c4\u5f8b\u4e86\u3002\u6bd4\u5982\uff0c\u8fd9\u4e9b\u786c\u76d8\u8bbe\u5907\u6587\u4ef6\u90fd\u662f\u4ee5sda\u5f00\u5934\u5e76\u4e14\u5b58\u653e\u5230\u4e86\/dev\u76ee\u5f55\u4e2d\uff0c\u8fd9\u6837\u4e00\u6765\uff0c\u5373\u4f7f\u4e0d\u77e5\u9053\u786c\u76d8\u7684\u5206\u533a\u7f16\u53f7\u548c\u5177\u4f53\u5206\u533a\u7684\u4e2a\u6570\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26\u6765\u641e\u5b9a\u3002<\/p>\n

\u6b63\u5982\u5176\u540d\uff0c\u901a\u914d\u7b26\u5c31\u662f\u901a\u7528\u7684\u5339\u914d\u4fe1\u606f\u7684\u7b26\u53f7\uff0c\u4f8b\u5982\uff0c\u661f\u53f7\uff08*\uff09\u4ee3\u8868\u5339\u914d\u96f6\u4e2a\u6216\u591a\u4e2a\u5b57\u7b26\uff0c\u95ee\u53f7\uff08?\uff09\u4ee3\u8868\u5339\u914d\u5355\u4e2a\u5b57\u7b26\uff0c\u4e2d\u62ec\u53f7\u5185\u52a0\u4e0a\u6570\u5b57[0-9]\u4ee3\u8868\u5339\u914d0\uff5e9\u4e4b\u95f4\u7684\u5355\u4e2a\u6570\u5b57\u7684\u5b57\u7b26\uff0c\u800c\u4e2d\u62ec\u53f7\u5185\u52a0\u4e0a\u5b57\u6bcd[abc]\u5219\u662f\u4ee3\u8868\u5339\u914da\u3001b\u3001c\u4e09\u4e2a\u5b57\u7b26\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u5b57\u7b26\u3002Linux\u7cfb\u7edf\u4e2d\u7684\u901a\u914d\u7b26\u53ca\u542b\u4e49\u5982\u88683-3\u6240\u793a\u3002<\/p>\n

\u88683-3\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Linux\u7cfb\u7edf\u4e2d\u7684\u901a\u914d\u7b26\u53ca\u542b\u4e49<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u901a\u914d\u7b26<\/td>\n\u542b\u4e49<\/td>\n<\/tr>\n
*<\/td>\n\u4efb\u610f\u5b57\u7b26<\/td>\n<\/tr>\n
?<\/td>\n\u5355\u4e2a\u4efb\u610f\u5b57\u7b26<\/td>\n<\/tr>\n
[a-z]<\/td>\n\u5355\u4e2a\u5c0f\u5199\u5b57\u6bcd<\/td>\n<\/tr>\n
[A-Z]<\/td>\n\u5355\u4e2a\u5927\u5199\u5b57\u6bcd<\/td>\n<\/tr>\n
[a-Z]<\/td>\n\u5355\u4e2a\u5b57\u6bcd<\/td>\n<\/tr>\n
[0-9]<\/td>\n\u5355\u4e2a\u6570\u5b57<\/td>\n<\/tr>\n
[[:alpha:]]<\/td>\n\u4efb\u610f\u5b57\u6bcd<\/td>\n<\/tr>\n
[[:upper:]]<\/td>\n\u4efb\u610f\u5927\u5199\u5b57\u6bcd<\/td>\n<\/tr>\n
[[:lower:]]<\/td>\n\u4efb\u610f\u5c0f\u5199\u5b57\u6bcd<\/td>\n<\/tr>\n
[[:digit:]]<\/td>\n\u6240\u6709\u6570\u5b57<\/td>\n<\/tr>\n
[[:alnum:]]<\/td>\n\u4efb\u610f\u5b57\u6bcd\u52a0\u6570\u5b57<\/td>\n<\/tr>\n
[[:punct:]]<\/td>\n\u6807\u70b9\u7b26\u53f7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u4fd7\u8bdd\u8bb2\u201c\u767e\u95fb\u4e0d\u5982\u4e00\u89c1\uff0c\u770b\u4e66\u4e0d\u5982\u5b9e\u9a8c\u201d\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u6765\u5339\u914d\u6240\u6709\u5728\/dev\u76ee\u5f55\u4e2d\u4e14\u4ee5sda\u5f00\u5934\u7684\u6587\u4ef6\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l \/dev\/sda*\r\nbrw-rw----. 1 root disk 8, 0 Sep 13 2024 \/dev\/sda\r\nbrw-rw----. 1 root disk 8, 1 Sep 13 2024 \/dev\/sda1\r\nbrw-rw----. 1 root disk 8, 2 Sep 13 2024 \/dev\/sda2\r\n<\/pre>\n

\u5982\u679c\u53ea\u60f3\u67e5\u770b\u6587\u4ef6\u540d\u4ee5sda\u5f00\u5934\uff0c\u4f46\u662f\u540e\u9762\u8fd8\u7d27\u8ddf\u5176\u4ed6\u67d0\u4e00\u4e2a\u5b57\u7b26\u7684\u6587\u4ef6\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u8fd9\u65f6\u5c31\u9700\u8981\u7528\u5230\u95ee\u53f7\u6765\u8fdb\u884c\u901a\u914d\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l \/dev\/sda?\r\nbrw-rw----. 1 root disk 8, 1 Sep 13 2024 \/dev\/sda1\r\nbrw-rw----. 1 root disk 8, 2 Sep 13 2024 \/dev\/sda2\r\n<\/pre>\n

\u9664\u4e86\u4f7f\u7528[0-9]\u6765\u5339\u914d0\uff5e9\u4e4b\u95f4\u7684\u5355\u4e2a\u6570\u5b57\uff0c\u4e5f\u53ef\u4ee5\u7528[135]\u8fd9\u6837\u7684\u65b9\u5f0f\u4ec5\u5339\u914d\u8fd93\u4e2a\u6307\u5b9a\u6570\u5b57\u4e2d\u7684\u4e00\u4e2a\uff1b\u82e5\u6ca1\u6709\u5339\u914d\u5230\u6570\u5b571\u62162\u62163\uff0c\u5219\u4e0d\u4f1a\u663e\u793a\u51fa\u6765\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l \/dev\/sda[0-9]\r\nbrw-rw----. 1 root disk 8, 1 Sep 13 2024 \/dev\/sda1\r\nbrw-rw----. 1 root disk 8, 2 Sep 13 2024 \/dev\/sda2\r\n[root@linuxprobe ~]# ls -l \/dev\/sda[135]\r\nbrw-rw----. 1 root disk 8, 1 Sep 13 2024 \/dev\/sda1\r\n<\/pre>\n
\n
\n
\n
\n

\u901a\u914d\u7b26\u4e0d\u4e00\u5b9a\u975e\u8981\u653e\u5230\u6700\u540e\u9762\uff0c\u4e5f\u53ef\u4ee5\u653e\u5230\u524d\u9762\u3002\u6bd4\u5982\uff0c\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u6765\u641c\u7d22\/etc\/\u76ee\u5f55\u4e2d\u6240\u6709\u4ee5.conf\u7ed3\u5c3e\u7684\u914d\u7f6e\u6587\u4ef6\u6709\u54ea\u4e9b\uff1a<\/p>\n

[root@linuxprobe ~]# ls -l \/etc\/*.conf\r\n-rw-r--r--. 1 root root      833 Aug 23  2024 \/etc\/appstream.conf\r\n-rw-r--r--. 1 root root       55 Feb 21  2024 \/etc\/asound.conf\r\n-rw-r--r--. 1 root root    28974 Aug 10  2024 \/etc\/brltty.conf\r\n-rw-r--r--. 1 root root     1369 Aug 29  2024 \/etc\/chrony.conf\r\n-rw-r--r--. 1 root dnsmasq 27839 Jan 29  2024 \/etc\/dnsmasq.conf\r\n-rw-r--r--. 1 root root      117 Feb 15  2024 \/etc\/dracut.conf\r\n-rw-r--r--. 1 root root       20 Aug 20  2024 \/etc\/fprintd.conf\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n

\u901a\u914d\u7b26\u4e0d\u4ec5\u53ef\u7528\u4e8e\u641c\u7d22\u6587\u4ef6\u6216\u4ee3\u66ff\u88ab\u901a\u914d\u7684\u5b57\u7b26\uff0c\u5b83\u8fd8\u80fd\u4e0e\u521b\u5efa\u6587\u4ef6\u7684\u547d\u4ee4\u76f8\u7ed3\u5408\uff0c\u4e00\u53e3\u6c14\u521b\u5efa\u51fa\u597d\u591a\u4e2a\u6587\u4ef6\u3002\u4e0d\u8fc7\u5728\u521b\u5efa\u591a\u4e2a\u6587\u4ef6\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u5927\u62ec\u53f7\uff0c\u5e76\u4e14\u5b57\u6bb5\u4e4b\u95f4\u7528\u9017\u53f7\u95f4\u9694\uff1a<\/p>\n

[root@linuxprobe ~]# touch {AA,BB,CC}.conf\r\n[root@linuxprobe ~]# ls -l *.conf\r\n-rw-r--r--. 1 root root 0 May  9 20:16 AA.conf\r\n-rw-r--r--. 1 root root 0 May  9 20:16 BB.conf\r\n-rw-r--r--. 1 root root 0 May  9 20:16 CC.conf\r\n<\/pre>\n

\u4f7f\u7528\u901a\u914d\u7b26\u8fd8\u53ef\u4ee5\u8f93\u51fa\u4e00\u4e9b\u6307\u5b9a\u7684\u4fe1\u606f\uff1a<\/p>\n<\/div>\n

[root@linuxprobe ~]# echo file{1,2,3,4,5}\r\nfile1 file2 file3 file4 file5<\/pre>\n
\n

\u901a\u914d\u7b26\u7684\u73a9\u6cd5\u7279\u522b\u591a\uff0c\u63a5\u4e0b\u6765\u5927\u5bb6\u5c31\u81ea\u884c\u63a2\u7d22\u3001\u81ea\u7531\u5b9e\u8df5\u5427\u3002<\/p>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u5b66\u4e60\u8bf7\u52a0\u8bfb\u8005\u7fa4\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff1ahttps:\/\/lrxjmw.cn\/club<\/a><\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u786e\u4fdd\u6bcf\u4e00\u4f4d\u7fa4\u53cb\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

3.4 \u5e38\u7528\u7684\u8f6c\u4e49\u5b57\u7b26<\/strong><\/span><\/h5>\n

\u4e3a\u4e86\u80fd\u591f\u66f4\u597d\u5730\u7406\u89e3\u7528\u6237\u7684\u8868\u8fbe\uff0cShell\u89e3\u91ca\u5668\u8fd8\u63d0\u4f9b\u4e86\u7279\u522b\u4e30\u5bcc\u7684\u8f6c\u4e49\u5b57\u7b26\u6765\u5904\u7406\u8f93\u5165\u7684\u7279\u6b8a\u6570\u636e\u3002\u5218\u9044\u8001\u5e08\u4ee5\u5341\u591a\u5e74\u7684\u5de5\u4f5c\u548c\u57f9\u8bad\u4e3a\u57fa\u7840\uff0c\u6123\u662f\u7528\u4e86\u4e24\u5468\u65f6\u95f4\u4ece\u6570\u5341\u4e2a\u8f6c\u4e49\u5b57\u7b26\u4e2d\u63d0\u70bc\u51fa\u4e864\u4e2a\u6700\u5e38\u7528\u7684\u8f6c\u4e49\u5b57\u7b26\uff01\u8fd9\u4ef6\u4e8b\u60c5\u4e5f\u8ba9\u6211\u6df1\u523b\u53cd\u7701\u4e86\u5f88\u957f\u65f6\u95f4\uff0c\u539f\u672c\u8ba4\u4e3a\u56fe\u4e66\u5199\u5f97\u8d8a\u539a\uff0c\u4f5c\u8005\u8d8a\u662f\u5927\u725b\uff0c\u73b0\u5728\u53d1\u73b0\u8fd9\u79cd\u89c2\u5ff5\u5b8c\u5168\u662f\u9519\u8bef\u7684\u3002<\/p>\n<\/div>\n

\n

4\u4e2a\u6700\u5e38\u7528\u7684\u8f6c\u4e49\u5b57\u7b26\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

\u53cd\u659c\u6760\uff08\\\uff09<\/strong>\uff1a\u4f7f\u53cd\u659c\u6760\u540e\u9762\u7684\u4e00\u4e2a\u53d8\u91cf\u53d8\u4e3a\u5355\u7eaf\u7684\u5b57\u7b26\u3002<\/p>\n

\u5355\u5f15\u53f7\uff08' '\uff09<\/strong>\uff1a\u8f6c\u4e49\u5176\u4e2d\u6240\u6709\u7684\u53d8\u91cf\u4e3a\u5355\u7eaf\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n

\u53cc\u5f15\u53f7\uff08\" \"\uff09<\/strong>\uff1a\u4fdd\u7559\u5176\u4e2d\u7684\u53d8\u91cf\u5c5e\u6027\uff0c\u4e0d\u8fdb\u884c\u8f6c\u4e49\u5904\u7406\u3002<\/p>\n

\u53cd\u5f15\u53f7\uff08` `\uff09<\/strong>\uff1a\u628a\u5176\u4e2d\u7684\u547d\u4ee4\u6267\u884c\u540e\u8fd4\u56de\u7ed3\u679c\u3002<\/p><\/blockquote>\n

\u9996\u5148\uff0c\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cfPRICE\u5e76\u8d4b\u503c\u4e3a5\uff0c\u7136\u540e\u8f93\u51fa\u4ee5\u53cc\u5f15\u53f7\u62ec\u8d77\u6765\u7684\u5b57\u7b26\u4e32\u4e0e\u53d8\u91cf\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# PRICE=5\r\n[root@linuxprobe ~]# echo \"Price is $PRICE\"\r\nPrice is\u00a05\r\n<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5e0c\u671b\u80fd\u591f\u8f93\u51fa\u5b57\u7b26\u4e32\u201cPrice is $5\u201d\uff0c\u5373\u201c\u4ef7\u683c\u662f5\u7f8e\u5143\u201d\uff0c\u4f46\u78b0\u5de7\u7f8e\u5143\u7b26\u53f7\u4e0e\u53d8\u91cf\u63d0\u53d6\u7b26\u53f7\u5408\u5e76\u540e\u7684$$\u4f5c\u7528\u662f\u663e\u793a\u5f53\u524d\u7a0b\u5e8f\u7684\u8fdb\u7a0bID\u53f7\u7801\uff0c\u4e8e\u662f\u547d\u4ee4\u6267\u884c\u540e\u8f93\u51fa\u7684\u5185\u5bb9\u5e76\u4e0d\u662f\u6211\u4eec\u6240\u9884\u671f\u7684\uff1a<\/p>\n<\/div>\n

[root@linuxprobe ~]# echo \"Price is $$PRICE\" \r\nPrice is 3767PRICE<\/pre>\n
\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\u5728Linux\u7cfb\u7edf\u7684\u7ec8\u7aef\u4e2d\uff0c$$\u4ee3\u8868\u67e5\u770b\u5f53\u524d\u8fdb\u7a0b\u7684PID\u53f7\u7801\u3002<\/div>\n<\/div>\n

\u8981\u60f3\u8ba9\u7b2c\u4e00\u4e2a\u201c$\u201d\u4e56\u4e56\u5730\u4f5c\u4e3a\u7f8e\u5143\u7b26\u53f7\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u4f7f\u7528\u53cd\u659c\u6760\uff08\\\uff09\u6765\u8fdb\u884c\u8f6c\u4e49\uff0c\u5c06\u8fd9\u4e2a\u547d\u4ee4\u63d0\u53d6\u7b26\u8f6c\u4e49\u6210\u5355\u7eaf\u7684\u6587\u672c\uff0c\u53bb\u9664\u5176\u7279\u6b8a\u529f\u80fd\uff1a<\/p>\n

\n
[root@linuxprobe ~]# echo \"Price is \\$$PRICE\"\r\nPrice is $5\r\n<\/pre>\n

\u800c\u5982\u679c\u53ea\u9700\u8981\u67d0\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u503c\uff0c\u53ef\u4ee5\u50cf`\u547d\u4ee4`\u8fd9\u6837\uff0c\u5c06\u547d\u4ee4\u7528\u53cd\u5f15\u53f7\u62ec\u8d77\u6765\uff0c\u8fbe\u5230\u9884\u671f\u7684\u6548\u679c\u3002\u4f8b\u5982\uff0c\u5c06\u53cd\u5f15\u53f7\u4e0euname -a\u547d\u4ee4\u7ed3\u5408\uff0c\u7136\u540e\u4f7f\u7528echo\u547d\u4ee4\u6765\u67e5\u770b\u672c\u673a\u7684Linux\u7248\u672c\u548c\u5185\u6838\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# echo `uname -a`\r\nLinux lrxjmw.cn 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 x86_64 x86_64 x86_64 GNU\/Linux<\/pre>\n<\/div>\n
\n
\n

\u53cd\u659c\u6760\u548c\u53cd\u5f15\u53f7\u7684\u529f\u80fd\u6bd4\u8f83\u6709\u7279\u70b9\uff0c\u540c\u5b66\u4eec\u4e00\u822c\u4e0d\u4f1a\u72af\u9519\uff0c\u4f46\u5bf9\u4e8e\u4ec0\u4e48\u65f6\u5019\u4f7f\u7528\u53cc\u5f15\u53f7\u5374\u5bb9\u6613\u6df7\u6dc6\uff0c\u56e0\u4e3a\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u597d\u50cf\u52a0\u4e0d\u52a0\u53cc\u5f15\u53f7\uff0c\u6548\u679c\u90fd\u4e00\u6837\uff1a<\/p>\n

[root@linuxprobe ~]# echo AA BB CC\r\nAA BB CC\r\n[root@linuxprobe ~]# echo \"AA BB CC\"\r\nAA BB CC<\/pre>\n

\u4e24\u8005\u7684\u533a\u522b\u5728\u4e8e\u7528\u6237\u65e0\u6cd5\u5f97\u77e5\u7b2c\u4e00\u79cd\u6267\u884c\u65b9\u5f0f\u4e2d\u5230\u5e95\u6709\u51e0\u4e2a\u53c2\u6570\u3002\u662f\u7684\uff0c\u4e0d\u80fd\u786e\u5b9a\uff01\u56e0\u4e3a\u6709\u53ef\u80fd\u628a\u201cAA BB CC\u201d\u5f53\u4f5c\u4e00\u4e2a\u53c2\u6570\u6574\u4f53\u76f4\u63a5\u8f93\u51fa\u5230\u5c4f\u5e55\uff0c\u4e5f\u6709\u53ef\u80fd\u5206\u522b\u5c06AA\u3001BB\u548cCC\u8f93\u51fa\u5230\u5c4f\u5e55\u3002\u800c\u4e14\uff0c\u5c31\u7b97\u6478\u6e05\u4e86echo\u547d\u4ee4\u5904\u7406\u53c2\u6570\u7684\u673a\u5236\uff0c\u5728\u4f7f\u7528\u5176\u4ed6\u547d\u4ee4\u65f6\u4f9d\u7136\u5b58\u5728\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n

\u8fd9\u91cc\u7ed9\u5927\u5bb6\u603b\u7ed3\u4e00\u4e2a\u6734\u5b9e\u65e0\u534e\u7684\u5c0f\u6280\u5de7\uff0c\u867d\u7136\u53ef\u80fd\u4e0d\u591f\u4e25\u8c28\uff0c\u4f46\u7edd\u5bf9\u7b80\u5355\uff1a\u5982\u679c\u53c2\u6570\u4e2d\u51fa\u73b0\u4e86\u7a7a\u683c\uff0c\u5c31\u52a0\u53cc\u5f15\u53f7\uff1b\u5982\u679c\u53c2\u6570\u4e2d\u6ca1\u6709\u7a7a\u683c\uff0c\u90a3\u5c31\u4e0d\u7528\u52a0\u53cc\u5f15\u53f7<\/strong>\u3002<\/p>\n<\/div>\n

3.5\u00a0\u91cd\u8981\u7684\u73af\u5883\u53d8\u91cf<\/strong><\/span><\/h5>\n

\u53d8\u91cf\u662f\u8ba1\u7b97\u673a\u7cfb\u7edf\u7528\u4e8e\u4fdd\u5b58\u53ef\u53d8\u503c\u7684\u6570\u636e\u7c7b\u578b\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53d8\u91cf\u540d\u79f0\u4e00\u822c\u90fd\u662f\u5927\u5199\u7684\uff0c\u547d\u4ee4\u5219\u90fd\u662f\u5c0f\u5199\u7684\uff0c\u8fd9\u662f\u4e00\u79cd\u7ea6\u5b9a\u4fd7\u6210\u7684\u89c4\u8303\u3002Linux\u7cfb\u7edf\u4e2d\u7684\u73af\u5883\u53d8\u91cf\u7528\u4e8e\u5b9a\u4e49\u7cfb\u7edf\u8fd0\u884c\u73af\u5883\u7684\u4e00\u4e9b\u53c2\u6570\uff0c\u6bd4\u5982\u6bcf\u4e2a\u7528\u6237\u4e0d\u540c\u7684\u5bb6\u76ee\u5f55\u3001\u90ae\u4ef6\u5b58\u653e\u4f4d\u7f6e\u7b49\u3002\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u53d8\u91cf\u540d\u79f0\u6765\u63d0\u53d6\u5230\u5bf9\u5e94\u7684\u53d8\u91cf\u503c\u3002<\/p>\n

\u7ec6\u5fc3\u7684\u8bfb\u8005\u5e94\u8be5\u5df2\u7ecf\u53d1\u73b0\uff0c\u672c\u8282\u548c\u4e0a\u4e00\u8282\u7684\u6807\u9898\u540d\u90fd\u5206\u522b\u52a0\u4e86\u5f62\u5bb9\u8bcd\u2014\u201c\u91cd\u8981\u7684\u201d\u3001\u201c\u5e38\u7528\u7684\u201d\u3002\u539f\u56e0\u5176\u5b9e\u4e0d\u8a00\u800c\u55bb\u2014\u8981\u60f3\u8ba9Linux\u7cfb\u7edf\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u5e76\u4e14\u4e3a\u7528\u6237\u63d0\u4f9b\u670d\u52a1\uff0c\u5219\u9700\u8981\u6570\u767e\u4e2a\u73af\u5883\u53d8\u91cf\u6765\u534f\u540c\u5de5\u4f5c\uff0c\u6211\u4eec\u6ca1\u6709\u5fc5\u8981\u9010\u4e00\u4ecb\u7ecd\u3001\u5b66\u4e60\u6bcf\u4e00\u4e2a\u53d8\u91cf\uff0c\u800c\u662f\u5e94\u8be5\u5728\u6709\u9650\u7684\u7bc7\u5e45\u4e2d\u7cbe\u8bb2\u6700\u91cd\u8981\u7684\u5185\u5bb9\u3002<\/p>\n

\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u53d8\u91cf\u7684\u4f5c\u7528\uff0c\u7ed9\u5927\u5bb6\u4e3e\u4e2a\u4f8b\u5b50\u3002\u524d\u6587\u4e2d\u66fe\u7ecf\u8bb2\u5230\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\u4e00\u5207\u90fd\u662f\u6587\u4ef6\uff0cLinux\u547d\u4ee4\u4e5f\u4e0d\u4f8b\u5916\u3002\u90a3\u4e48\uff0c\u5728\u7528\u6237\u6267\u884c\u4e00\u6761\u547d\u4ee4\u4e4b\u540e\uff0cLinux\u7cfb\u7edf\u4e2d\u5230\u5e95\u53d1\u751f\u4e86\u4ec0\u4e48\u4e8b\u60c5\u5462\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u547d\u4ee4\u5728Linux\u4e2d\u7684\u6267\u884c\u5206\u4e3a4\u4e2a\u6b65\u9aa4\u3002<\/p>\n

\u7b2c1\u6b65<\/strong>\uff1a\u5224\u65ad\u7528\u6237\u662f\u5426\u4ee5\u7edd\u5bf9\u8def\u5f84\u6216\u76f8\u5bf9\u8def\u5f84\u7684\u65b9\u5f0f\u8f93\u5165\u547d\u4ee4\uff08\u5982\/bin\/ls\uff09\uff0c\u5982\u679c\u662f\u7edd\u5bf9\u8def\u5f84\u5219\u76f4\u63a5\u6267\u884c\uff0c\u5426\u5219\u8fdb\u5165\u7b2c2\u6b65\u7ee7\u7eed\u5224\u65ad\u3002<\/p>\n

\u7b2c2\u6b65<\/strong>\uff1aLinux\u7cfb\u7edf\u68c0\u67e5\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4\u662f\u5426\u4e3a\u201c\u522b\u540d\u547d\u4ee4\u201d\uff0c\u5373\u7528\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684\u547d\u4ee4\u540d\u79f0\u6765\u66ff\u6362\u539f\u672c\u7684\u547d\u4ee4\u540d\u79f0\u3002<\/p>\n

\u4e4b\u524d\u5728\u4f7f\u7528rm\u547d\u4ee4\u5220\u9664\u6587\u4ef6\u65f6\uff0cLinux\u7cfb\u7edf\u90fd\u4f1a\u8981\u6c42\u7528\u6237\u786e\u8ba4\u662f\u5426\u6267\u884c\u5220\u9664\u64cd\u4f5c\uff0c\u5176\u5b9e\u8fd9\u5c31\u662fLinux\u7cfb\u7edf\u4e3a\u4e86\u9632\u6b62\u7528\u6237\u8bef\u5220\u9664\u6587\u4ef6\u800c\u7279\u610f\u8bbe\u7f6e\u7684rm\u522b\u540d\u547d\u4ee4\u2014\u201crm -i\u201d\u3002<\/p>\n

[root@linuxprobe ~]# ls\r\nanaconda-ks.cfg  Documents  Music     Public     Videos\r\nDesktop          Downloads  Pictures  Templates\r\n[root@linuxprobe ~]# rm -r Music\r\nrm: remove directory 'Music'? y\r\n<\/pre>\n

\u53ef\u4ee5\u7528alias\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u5c5e\u4e8e\u81ea\u5df1\u7684\u547d\u4ee4\u522b\u540d\uff0c\u8bed\u6cd5\u683c\u5f0f\u4e3a\u201calias\u522b\u540d=\u547d\u4ee4\u201d\u3002\u82e5\u8981\u53d6\u6d88\u4e00\u4e2a\u547d\u4ee4\u522b\u540d\uff0c\u5219\u662f\u7528unalias\u547d\u4ee4\uff0c\u8bed\u6cd5\u683c\u5f0f\u4e3a\u201cunalias\u522b\u540d\u201d\u3002<\/p>\n

\u5c06\u5f53\u524drm\u547d\u4ee4\u6240\u88ab\u8bbe\u7f6e\u7684\u522b\u540d\u53d6\u6d88\u6389\uff0c\u518d\u5220\u9664\u6587\u4ef6\u8bd5\u8bd5\uff1a<\/p>\n<\/div>\n

\n
\n
[root@linuxprobe ~]# unalias rm\r\n[root@linuxprobe ~]# rm -r Videos\r\n[root@linuxprobe ~]#<\/pre>\n<\/div>\n

\u7b2c3\u6b65<\/strong>\uff1aBash\u89e3\u91ca\u5668\u5224\u65ad\u7528\u6237\u8f93\u5165\u7684\u662f\u5185\u90e8\u547d\u4ee4\u8fd8\u662f\u5916\u90e8\u547d\u4ee4\u3002\u5185\u90e8\u547d\u4ee4\u662f\u89e3\u91ca\u5668\u5185\u90e8\u7684\u6307\u4ee4\uff0c\u4f1a\u88ab\u76f4\u63a5\u6267\u884c\uff1b\u800c\u7528\u6237\u5728\u7edd\u5927\u90e8\u5206\u65f6\u95f4\u8f93\u5165\u7684\u662f\u5916\u90e8\u547d\u4ee4\uff0c\u8fd9\u4e9b\u547d\u4ee4\u4ea4\u7531\u6b65\u9aa44\u7ee7\u7eed\u5904\u7406\u3002\u53ef\u4ee5\u4f7f\u7528\u201ctype\u547d\u4ee4\u540d\u79f0\u201d\u6765\u5224\u65ad\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4\u662f\u5185\u90e8\u547d\u4ee4\u8fd8\u662f\u5916\u90e8\u547d\u4ee4\uff1a<\/p>\n

[root@linuxprobe ~]# type echo\r\necho is a shell builtin\r\n[root@linuxprobe ~]# type uptime\r\nuptime is \/usr\/bin\/uptime<\/pre>\n

\u7b2c4\u6b65<\/strong>\uff1a\u7cfb\u7edf\u5728\u591a\u4e2a\u8def\u5f84\u4e2d\u67e5\u627e\u7528\u6237\u8f93\u5165\u7684\u547d\u4ee4\u6587\u4ef6\uff0c\u800c\u5b9a\u4e49\u8fd9\u4e9b\u8def\u5f84\u7684\u53d8\u91cf\u53eb\u4f5cPATH\uff0c\u53ef\u4ee5\u7b80\u5355\u5730\u628a\u5b83\u7406\u89e3\u6210\u662f\u201c\u89e3\u91ca\u5668\u7684\u5c0f\u52a9\u624b\u201d\uff0c\u4f5c\u7528\u662f\u544a\u8bc9Bash\u89e3\u91ca\u5668\u5f85\u6267\u884c\u7684\u547d\u4ee4\u53ef\u80fd\u5b58\u653e\u7684\u4f4d\u7f6e\uff0c\u7136\u540eBash\u89e3\u91ca\u5668\u5c31\u4f1a\u4e56\u4e56\u5730\u5728\u8fd9\u4e9b\u4f4d\u7f6e\u4e2d\u9010\u4e2a\u67e5\u627e\u3002PATH\u662f\u7531\u591a\u4e2a\u8def\u5f84\u503c\u7ec4\u6210\u7684\u53d8\u91cf\uff0c\u6bcf\u4e2a\u8def\u5f84\u503c\u4e4b\u95f4\u7528\u5192\u53f7\u95f4\u9694\uff0c\u5bf9\u8fd9\u4e9b\u8def\u5f84\u7684\u589e\u52a0\u548c\u5220\u9664\u64cd\u4f5c\u5c06\u5f71\u54cd\u5230Bash\u89e3\u91ca\u5668\u5bf9Linux\u547d\u4ee4\u7684\u67e5\u627e\u3002<\/p>\n

[root@linuxprobe ~]# echo $PATH\r\n\/root\/.local\/bin:\/root\/bin:\/usr\/local\/bin:\/usr\/local\/sbin:\/usr\/bin:\/usr\/sbin\r\n[root@linuxprobe ~]# PATH=$PATH:\/root\/bin\r\n<\/strong>[root@linuxprobe ~]# echo $PATH\r\n\/root\/.local\/bin:\/root\/bin:\/usr\/local\/bin:\/usr\/local\/sbin:\/usr\/bin:\/usr\/sbin:\/root\/bin<\/strong>\r\n<\/pre>\n

\u8fd9\u91cc\u6709\u4e2a\u6bd4\u8f83\u7ecf\u5178\u7684\u95ee\u9898\uff1a\u201c\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u5c06\u5f53\u524d\u76ee\u5f55\uff08.\uff09\u6dfb\u52a0\u5230PATH\u4e2d\u5462\uff1f\u201d\u539f\u56e0\u662f\uff0c\u5c3d\u7ba1\u5141\u8bb8\u5c06\u5f53\u524d\u76ee\u5f55\uff08.\uff09\u6dfb\u52a0\u5230PATH\u53d8\u91cf\u4e2d\uff0c\u4ece\u800c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u4ee5\u8ba9\u7528\u6237\u514d\u53bb\u8f93\u5165\u547d\u4ee4\u6240\u5728\u8def\u5f84\u7684\u9ebb\u70e6\u3002\u4f46\u662f\uff0c\u5982\u679c\u9ed1\u5ba2\u5728\u6bd4\u8f83\u5e38\u7528\u7684\u516c\u5171\u76ee\u5f55\/tmp\u4e2d\u5b58\u653e\u4e86\u4e00\u4e2a\u4e0els\u6216cd\u547d\u4ee4\u540c\u540d\u7684\u6728\u9a6c\u6587\u4ef6\uff0c\u800c\u7528\u6237\u53c8\u6070\u5de7\u5728\u516c\u5171\u76ee\u5f55\u4e2d\u6267\u884c\u4e86\u8fd9\u4e9b\u547d\u4ee4\uff0c\u90a3\u4e48\u5c31\u6781\u6709\u53ef\u80fd\u4e2d\u62db\u4e86\uff0c\u5927\u5927\u7684\u5b89\u5168\u9690\u60a3\u3002<\/p>\n

\u56e0\u6b64\uff0c\u4f5c\u4e3a\u4e00\u540d\u6001\u5ea6\u8c28\u614e\u4e14\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8fd0\u7ef4\u4eba\u5458\uff0c\u63a5\u624b\u4e00\u53f0Linux\u7cfb\u7edf\u540e\u4e00\u5b9a\u4f1a\u5728\u6267\u884c\u547d\u4ee4\u524d\u5148\u68c0\u67e5PATH\u53d8\u91cf\u4e2d\u662f\u5426\u6709\u53ef\u7591\u7684\u76ee\u5f55\u3002\u53e6\u5916\uff0c\u8bfb\u8005\u4ece\u524d\u9762\u7684PATH\u53d8\u91cf\u793a\u4f8b\u4e2d\u662f\u5426\u4e5f\u611f\u89c9\u5230\u73af\u5883\u53d8\u91cf\u7279\u522b\u6709\u7528\u5462\uff1f\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528env\u547d\u4ee4\u6765\u67e5\u770bLinux\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u73af\u5883\u53d8\u91cf\uff0c\u800c\u5218\u9044\u8001\u5e08\u4e3a\u60a8\u7cbe\u6311\u7ec6\u9009\u51fa\u4e86\u6700\u91cd\u8981\u7684\u5341\u4e2a\u73af\u5883\u53d8\u91cf\uff0c\u5982\u88683-4\u6240\u793a\u3002<\/p>\n

\u88683-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux\u7cfb\u7edf\u4e2d\u6700\u91cd\u8981\u7684\u5341\u4e2a\u73af\u5883\u53d8\u91cf<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53d8\u91cf\u540d\u79f0<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
HOME<\/td>\n\u7528\u6237\u7684\u4e3b\u76ee\u5f55\uff08\u5373\u5bb6\u76ee\u5f55\uff09<\/td>\n<\/tr>\n
SHELL<\/td>\n\u7528\u6237\u5728\u4f7f\u7528\u7684Shell\u89e3\u91ca\u5668\u540d\u79f0<\/td>\n<\/tr>\n
HISTSIZE<\/td>\n\u8f93\u51fa\u7684\u5386\u53f2\u547d\u4ee4\u8bb0\u5f55\u6761\u6570<\/td>\n<\/tr>\n
HISTFILESIZE<\/td>\n\u4fdd\u5b58\u7684\u5386\u53f2\u547d\u4ee4\u8bb0\u5f55\u6761\u6570<\/td>\n<\/tr>\n
MAIL<\/td>\n\u90ae\u4ef6\u4fdd\u5b58\u8def\u5f84<\/td>\n<\/tr>\n
LANG<\/td>\n\u7cfb\u7edf\u8bed\u8a00\u3001\u8bed\u7cfb\u540d\u79f0<\/td>\n<\/tr>\n
RANDOM<\/td>\n\u751f\u6210\u4e00\u4e2a\u968f\u673a\u6570\u5b57<\/td>\n<\/tr>\n
PS1<\/td>\nBash\u89e3\u91ca\u5668\u7684\u63d0\u793a\u7b26<\/td>\n<\/tr>\n
PATH<\/td>\n\u5b9a\u4e49\u89e3\u91ca\u5668\u641c\u7d22\u7528\u6237\u6267\u884c\u547d\u4ee4\u7684\u8def\u5f84<\/td>\n<\/tr>\n
EDITOR<\/td>\n\u7528\u6237\u9ed8\u8ba4\u7684\u6587\u672c\u7f16\u8f91\u5668<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

Linux\u4f5c\u4e3a\u4e00\u4e2a\u591a\u7528\u6237\u3001\u591a\u4efb\u52a1\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u80fd\u591f\u4e3a\u6bcf\u4e2a\u7528\u6237\u63d0\u4f9b\u72ec\u7acb\u7684\u3001\u5408\u9002\u7684\u5de5\u4f5c\u8fd0\u884c\u73af\u5883\u3002\u56e0\u6b64\uff0c\u4e00\u4e2a\u76f8\u540c\u7684\u53d8\u91cf\u4f1a\u56e0\u4e3a\u7528\u6237\u8eab\u4efd\u7684\u4e0d\u540c\u800c\u5177\u6709\u4e0d\u540c\u7684\u503c\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u6765\u67e5\u770bHOME\u53d8\u91cf\u5728\u4e0d\u540c\u7684\u7528\u6237\u8eab\u4efd\u4e0b\u90fd\u6709\u54ea\u4e9b\u503c\uff08su\u662f\u7528\u4e8e\u5207\u6362\u7528\u6237\u8eab\u4efd\u7684\u547d\u4ee4\uff0c\u5c06\u5728\u7b2c5\u7ae0\u8ddf\u5927\u5bb6\u89c1\u9762\uff09\uff1a<\/p>\n

[root@linuxprobe ~]# echo $HOME\r\n\/root\r\n[root@linuxprobe ~]# su - linuxprobe\r\n[linuxprobe@linuxprobe ~]$ echo $HOME\r\n\/home\/linuxprobe\r\n<\/pre>\n

\u5176\u5b9e\u53d8\u91cf\u662f\u7531\u56fa\u5b9a\u7684\u53d8\u91cf\u540d\u4e0e\u7528\u6237\u6216\u7cfb\u7edf\u8bbe\u7f6e\u7684\u53d8\u91cf\u503c\u4e24\u90e8\u5206\u7ec4\u6210\u7684\uff0c\u6211\u4eec\u5b8c\u5168\u53ef\u4ee5\u81ea\u884c\u521b\u5efa\u53d8\u91cf\u6765\u6ee1\u8db3\u5de5\u4f5c\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u540d\u79f0\u4e3aWORKDIR\u7684\u53d8\u91cf\uff0c\u65b9\u4fbf\u7528\u6237\u66f4\u8f7b\u677e\u5730\u8fdb\u5165\u4e00\u4e2a\u5c42\u6b21\u8f83\u6df1\u7684\u76ee\u5f55\uff1a<\/p>\n

[root@linuxprobe ~]# mkdir \/home\/workdir\r\n[root@linuxprobe ~]# WORKDIR=\/home\/workdir\r\n[root@linuxprobe ~]# cd $WORKDIR \r\n[root@linuxprobe workdir]# pwd\r\n\/home\/workdir\r\n<\/pre>\n

\u4f46\u662f\uff0c\u8fd9\u6837\u7684\u53d8\u91cf\u4e0d\u5177\u6709\u5168\u5c40\u6027\uff0c\u4f5c\u7528\u8303\u56f4\u4e5f\u6709\u9650\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u80fd\u88ab\u5176\u4ed6\u7528\u6237\u4f7f\u7528\uff1a<\/p>\n

[root@linuxprobe workdir]# su linuxprobe\r\n[linuxprobe@linuxprobe ~]$ cd $WORKDIR\r\n[linuxprobe@linuxprobe ~]$ echo $WORKDIR\r\n[linuxprobe@linuxprobe ~]$ exit\r\n<\/pre>\n

\u5982\u679c\u5de5\u4f5c\u9700\u8981\uff0c\u53ef\u4ee5\u4f7f\u7528export\u547d\u4ee4\u5c06\u5176\u63d0\u5347\u4e3a\u5168\u5c40\u53d8\u91cf\uff0c\u8fd9\u6837\u5176\u4ed6\u7528\u6237\u4e5f\u5c31\u53ef\u4ee5\u4f7f\u7528\u5b83\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# export\u00a0WORKDIR\r\n[root@linuxprobe ~]# su linuxprobe\r\n[linuxprobe@linuxprobe ~]$ cd $WORKDIR\r\n[linuxprobe@linuxprobe workdir]$ pwd\r\n\/home\/workdir\r\n<\/pre>\n

\u540e\u7eed\u8981\u662f\u4e0d\u4f7f\u7528\u8fd9\u4e2a\u53d8\u91cf\u4e86\uff0c\u5219\u53ef\u6267\u884cunset\u547d\u4ee4\u628a\u5b83\u53d6\u6d88\u6389\uff1a<\/p>\n

[root@linuxprobe ~]# unset WORKDIR\r\n[root@linuxprobe ~]#<\/pre>\n
\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\u76f4\u63a5\u5728\u7ec8\u7aef\u8bbe\u7f6e\u7684\u53d8\u91cf\u80fd\u591f\u7acb\u5373\u751f\u6548\uff0c\u4f46\u5728\u91cd\u542f\u670d\u52a1\u5668\u540e\u5c31\u4f1a\u5931\u6548\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u5c06\u53d8\u91cf\u548c\u53d8\u91cf\u503c\u5199\u5165\u5230.bashrc\u6216\u8005.bash_profile\u6587\u4ef6\u4e2d\uff0c\u4ee5\u786e\u4fdd\u6c38\u4e45\u80fd\u4f7f\u7528\u5b83\u4eec\u3002\u4ec0\u4e48\uff1f\u4e0d\u77e5\u9053\u8be5\u600e\u4e48\u7f16\u8f91\u6587\u4ef6\uff1f\u5feb\u6765\u770b\u7b2c4\u7ae0\u5427\u3002<\/div>\n<\/div>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u5b66\u4e60\u8bf7\u52a0\u8bfb\u8005\u7fa4\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff1ahttps:\/\/lrxjmw.cn\/club<\/a><\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u786e\u4fdd\u6bcf\u4e00\u4f4d\u7fa4\u53cb\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

\u672c\u7ae0\u8282\u7684\u590d\u4e60\u4f5c\u4e1a<\/span>(\u7b54\u6848\u5c31\u5728\u95ee\u9898\u7684\u4e0b\u4e00\u884c\u54e6\uff0c\u7528\u9f20\u6807\u9009\u4e2d\u5373\u53ef\u770b\u5230\u7684~)<\/strong><\/span><\/p>\n

1\uff0e\u628als\u547d\u4ee4\u7684\u6b63\u5e38\u8f93\u51fa\u4fe1\u606f\u8ffd\u52a0\u5199\u5165\u5230error.txt\u6587\u4ef6\u4e2d\u7684\u547d\u4ee4\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>ls >> error.txt\uff08\u6ce8\u610f\u533a\u5206>\u548c>>\u7684\u4e0d\u540c\uff09\u3002<\/span><\/p>\n

2\uff0e\u8bf7\u7b80\u5355\u6982\u8ff0\u7ba1\u9053\u7b26\u7684\u4f5c\u7528\u3002<\/p>\n

\u7b54\uff1a<\/strong>\u628a\u5de6\u9762\uff08\u524d\u9762\uff09\u547d\u4ee4\u7684\u8f93\u51fa\u503c\u4f5c\u4e3a\u53f3\u9762\uff08\u540e\u9762\uff09\u547d\u4ee4\u7684\u8f93\u5165\u503c\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u5904\u7406\u4fe1\u606f\u3002<\/span><\/p>\n

3\uff0eBash\u89e3\u91ca\u5668\u7684\u901a\u914d\u7b26\u4e2d\uff0c\u661f\u53f7\uff08*\uff09\u4ee3\u8868\u51e0\u4e2a\u5b57\u7b26\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u96f6\u4e2a\u6216\u591a\u4e2a\u3002<\/span><\/p>\n

4\uff0ePATH\u53d8\u91cf\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u8bbe\u5b9a\u89e3\u91ca\u5668\u641c\u7d22\u6240\u6267\u884c\u547d\u4ee4\u7684\u8def\u5f84\uff0c\u627e\u5230\u5176\u6240\u5728\u4f4d\u7f6e\u3002<\/span><\/p>\n

5\uff0e\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4e3a\u53c2\u6570\u6dfb\u52a0\u53cc\u5f15\u53f7\u6709\u4ec0\u4e48\u597d\u5904\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u53cc\u5f15\u53f7\u901a\u5e38\u7528\u4e8e\u754c\u5b9a\u53c2\u6570\u7684\u4e2a\u6570\uff0c\u4ee5\u514d\u7a0b\u5e8f\u6216\u547d\u4ee4\u5728\u6267\u884c\u65f6\u4ea7\u751f\u6b67\u4e49\uff0c\u56e0\u6b64\u53c2\u6570\u4e2d\u82e5\u6709\u7a7a\u683c\uff0c\u5219\u5efa\u8bae\u6dfb\u52a0\u53cc\u5f15\u53f7\u3002<\/span><\/p>\n

6\uff0e\u4f7f\u7528\u4ec0\u4e48\u547d\u4ee4\u53ef\u4ee5\u628a\u540d\u4e3aLINUX\u7684\u4e00\u822c\u53d8\u91cf\u8f6c\u6362\u6210\u5168\u5c40\u53d8\u91cf\uff1f<\/p>\n

\u7b54<\/strong>\uff1a<\/strong>export LINUX\u3002<\/span><\/p>\n

7\uff0e\u5982\u4f55\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u4e2d\u5df2\u6709\u7684\u6240\u6709\u522b\u540d\u547d\u4ee4\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u4f7f\u7528alias\u547d\u4ee4\u3002<\/span><\/p>\n

8\uff0e\u5982\u4f55\u533a\u5206Linux\u7cfb\u7edf\u7684\u5185\u90e8\u547d\u4ee4\u548c\u5916\u90e8\u547d\u4ee4\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u4f7f\u7528type\u547d\u4ee4\u52a0\u4e0a\u8981\u67e5\u8be2\u7684\u547d\u4ee4\u540d\u5373\u53ef\uff0c\u4f8b\u5982\uff1a\u201ctype update\u201d\u3002<\/span><\/p>\n

9\uff0e\u9664\u4e86\u4f7f\u7528unset\u547d\u4ee4\uff0c\u8fd8\u6709\u4ec0\u4e48\u65b9\u6cd5\u80fd\u8ba9\u521a\u521b\u5efa\u7684\u53d8\u91cf\u5931\u6548\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u82e5\u672a\u5199\u5165\u5230\u914d\u7f6e\u6587\u4ef6\uff0c\u5219\u91cd\u542f\u7ec8\u7aef\u7a97\u53e3\u6216\u670d\u52a1\u5668\u5747\u53ef\u64a4\u9500\u521a\u521b\u5efa\u7684\u53d8\u91cf\u3002<\/span><\/p>\n

10\uff0e\u4e0d\u60f3\u533a\u5206\u8f93\u51fa\u4fe1\u606f\u7684\u7c7b\u578b\uff08\u6b63\u5e38\u6216\u62a5\u9519\u5747\u53ef\uff09\uff0c\u5168\u90fd\u91cd\u5b9a\u5411\u5199\u5165\u5230\u6587\u4ef6\uff0c\u5e94\u4f7f\u7528\u4ec0\u4e48\u64cd\u4f5c\u7b26\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u5e94\u4f7f\u7528&>\u6216&>>\u64cd\u4f5c\u7b26\u3002<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

\u7ae0\u8282\u6982\u8ff0\uff1a \u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5df2\u7ecf\u5b66\u4e60\u4e8650\u591a\u4e2a\u5e38\u7528\u7684Linux\u7cfb\u7edf\u547d\u4ee4\uff0c\u5982\u679c\u4e0d\u80fd\u628a\u8fd9\u4e9b\u547d\u4ee4\u8fdb\u884c\u7ec4\u5408\u4f7f\u7528\uff0c\u4fbf\u96be\u4ee5\u4e8b […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2632],"tags":[],"class_list":["post-291340","post","type-post","status-publish","format-standard","hentry","category-rhel10"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291340","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=291340"}],"version-history":[{"count":27,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291340\/revisions"}],"predecessor-version":[{"id":292240,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291340\/revisions\/292240"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=291340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=291340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=291340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}