{"id":174415,"date":"2020-03-26T09:26:03","date_gmt":"2020-03-26T01:26:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=174415"},"modified":"2020-03-16T08:27:31","modified_gmt":"2020-03-16T00:27:31","slug":"linux-general-commands","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-general-commands.html","title":{"rendered":"Linux\u91cc\u5e38\u7528\u547d\u4ee4"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u4f60\u77e5\u9053\u4f60\u81ea\u5df1\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u662f\u54ea\u51e0\u4e2a\u547d\u4ee4\u5462?\u4eca\u5929\u6211\u4eec\u5c31\u6765\u67e5\u770b\u4e00\u4e0b\u81ea\u5df1\u5728\u4f7f\u7528 Linux \u8fc7\u7a0b\u4e2d\u6700\u7ecf\u5e38\u7528\u7684\u547d\u4ee4\u5427\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u4e0d\u77e5\u9053\u5927\u5bb6\u81ea\u63a5\u89e6 Linux \u4ee5\u6765\uff0c\u90fd\u4f7f\u7528\u8fc7\u54ea\u4e9b\u547d\u4ee4\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u547d\u4ee4\u662f\u4ec0\u4e48?<\/p>\n \u6211\u6700\u5e38\u7528\u7684\u547d\u4ee4\u4e4b\u4e00\u662f sudo \uff0c\u56e0\u4e3a\u6211\u6bcf\u5929\u90fd\u5728\u4f7f\u7528\u5b83\u5728 Linux \u4e0a\u5b89\u88c5\u3001\u66f4\u65b0\u3001\u5220\u9664\u8f6f\u4ef6\u5305\u4ee5\u53ca\u5176\u5b83\u5404\u79cd\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u7684\u64cd\u4f5c\u3002<\/p>\n \u90a3\u4e48\u4f60\u77e5\u9053\u4f60\u81ea\u5df1\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u662f\u54ea\u51e0\u4e2a\u547d\u4ee4\u5462?\u4eca\u5929\u6211\u4eec\u5c31\u6765\u67e5\u770b\u4e00\u4e0b\u81ea\u5df1\u5728\u4f7f\u7528 Linux \u8fc7\u7a0b\u4e2d\u6700\u7ecf\u5e38\u7528\u7684\u547d\u4ee4\u5427\u3002<\/p>\n \u5728 Linux \u4e0a\u67e5\u770b\u4f60\u81ea\u5df1\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4<\/strong><\/div>\n \u5728 Linux \u4e2d\uff0c\u5386\u53f2\u6587\u4ef6 ~\/.bash_history \u4f1a\u8bb0\u5f55\u4f60\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u8fc7\u7684\u6240\u6709\u547d\u4ee4\uff0c\u6240\u4ee5\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u6765\u5bfb\u627e\u4f60\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\u3002<\/p>\n \u5177\u4f53\u505a\u6cd5\u5982\u4e0b\uff1a<\/p>\n $ history | awk '{print $2}' | sort | uniq -c | sort -nr | head -5 <\/pre>\n \u4ece\u7ed3\u679c\u4e2d\u53ef\u4ee5\u770b\u5230\u7684\uff0csudo \u662f\u5f53\u524d\u7528\u6237\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\uff0c\u4f7f\u7528\u4e86 153 \u6b21\u3002<\/p>\n \u7ed3\u679c\u7684\u663e\u793a\u662f\u964d\u5e8f\u7684\uff0c\u82e5\u4f60\u8981\u8ba9\u5b83\u5347\u5e8f\u663e\u793a\uff0c\u90a3\u4e48\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n $ history | awk {'print $2'} | sort | uniq -c | sort -n | tail -n5 <\/pre>\n |