{"id":116080,"date":"2018-09-01T08:28:00","date_gmt":"2018-09-01T00:28:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=116080"},"modified":"2018-08-24T09:28:57","modified_gmt":"2018-08-24T01:28:57","slug":"linux-noticed-cmd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-noticed-cmd.html","title":{"rendered":"\u5217\u4e3e\u4e00\u4e0b\u4f60\u53ef\u80fd\u6ca1\u6ce8\u610f\u7684Linux\u547d\u4ee4"},"content":{"rendered":"
\u8fd9\u7bc7\u6587\u7ae0\u4ec5\u8ba8\u8bba Linux \u73af\u5883\u4e0b\u7684\u4e1c\u897f\uff0c\u5f88\u663e\u7136\u5bf9 MacOS \u4e5f\u9002\u7528\u3002\u5176\u5b9e\u5f88\u591a\u4e1c\u897f\u867d\u7136\u6709 Windows \u4e5f\u53ef\u4ee5\u627e\u7684\u5230\u4f46\u914d\u7f6e\u6bd4\u8f83\u9ebb\u70e6\uff0c\u8fd9\u91cc\u4e0d\u518d\u4ed4\u7ec6\u8bb2\u3002\u5f88\u591a\u4e1c\u897f\u50cf Linux \u8001\u9e1f\u770b\u8d77\u6765\u4f1a\u89c9\u5f97\u54c8\u54c8\u54c8\u5b9e\u5728\u662f\u592a\u57fa\u7840\u3002\u4f46\u662f\u50cf cd, ls, mkdir \u8fd9\u4e9b\u592a\u57fa\u7840\u7684\u5199\u5728\u8fd9\u91cc\u53c8\u663e\u5f97\u592a\u4e1a\u4f59\uff0c\u6240\u4ee5\u5f88\u591a\u5341\u5206\u5e38\u7528\u7684\u547d\u4ee4\u8fd9\u8fb9\u6211\u4e5f\u8df3\u8fc7\u4e86\u3002\u50cfgit\u8fd9\u79cd\u91cd\u91cf\u7ea7\u7684\u5de5\u5177\uff0c\u548csed,awk\u8fd9\u4e9b\u80fd\u5355\u72ec\u51fa\u4e66\u7684\u4e1c\u897f\u6211\u89c9\u5f97\u6211\u4e5f\u8bb2\u4e0d\u6e05\u695a\uff0c\u6240\u4ee5\u8fd9\u8fb9\u90fd\u662f\u529f\u80fd\u7b80\u5355\u7684\u5c0f\u4e1c\u897f\u3002\u4e0d\u8fc7\u8fd9\u4e9b\u5c0f\u95ee\u9898\u5c31\u7b97\u4e86\u5427...<\/p>\n
\u90a3\u4e48\u4e0d\u5982\u770b\u770b\u8fd9\u672c\u4e66\u5427: <<The Linux Command Line>>\u3002\u4e66\u7684\u5185\u5bb9\u5c31\u8ddf\u6807\u9898\u4e00\u6837\uff0c\u6df1\u5165\u6d45\u51fa\u7684\u4ecb\u7ecd\u4e86\u6240\u8c13 \"Linux \u547d\u4ee4\u884c\" \u7684\u65b9\u65b9\u9762\u9762\uff0c\u672c\u6587\u5f88\u591a\u5185\u5bb9\u4e5f\u662f\u4ece\u4e66\u91cc\u770b\u5230\u7684\u3002\u7f51\u7ad9\u4e0a\u6709 PDF \u5408\u6cd5\u514d\u8d39\u4e0b\u8f7d\uff0c\u4e66\u5199\u7684\u5f88\u597d\u53ef\u4ee5\u5f88\u968f\u610f\u7684\u770b\u4e0d\u4f1a\u89c9\u5f97\u538b\u529b\u592a\u5927\u3002\u6700\u4e3b\u8981\u7684\uff0c\u5982\u679c\u4f60\u662f\u521a\u521a\u63a5\u89e6 Linux \u90a3\u4e48\u8fd9\u4e2a\u8bf4\u4e0d\u5b9a\u662f\u6700\u597d\u7684\u4e0a\u624b\u6559\u7a0b\uff0c\u6211\u5341\u5206\u540e\u6094\u539f\u6765\u4e0d\u77e5\u9053\u8fd9\u4e48\u4e66\u3002\u8fd9\u4e48\u8bf4\u8d77\u6765\u53e6\u5916\u4e00\u672c Linux \u5165\u95e8\u5927\u5e08\u7ea7\u6559\u7a0b\u5e94\u8be5\u662f\u9e1f\u54e5\u79c1\u623f\u83dc\uff0c\u8fd9\u4e2a\u5b9e\u5728\u662f\u592a\u51fa\u540d\u4ee5\u81f3\u4e8e\u6211\u89c9\u5f97\u6ca1\u4ec0\u4e48\u53ef\u4ee5\u8bf4\u7684\u3002<\/p>\n
\u90a3\u4e0b\u9762\u5c31\u4ee5\u968f\u673a\u7684\u987a\u5e8f\u5217\u51fa\u4e00\u4e9b\u6211\u89c9\u5f97\u975e\u5e38\u68d2\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\u8fd9\u91cc\u4e0d\u8be6\u7ec6\u4ecb\u7ecd\u5404\u79cd\u53c2\u6570\uff0c\u4f60\u5e94\u8be5\u505a\u7684\u662f\u7528 man xxx \u6765\u67e5\u770b\u6587\u6863\u3002\u5982\u679c\u8fd9\u4e9b\u7a0b\u5e8f\u5728\u4f60\u7684\u53d1\u884c\u7248\u91cc\u6ca1\u6709\u5b89\u88c5\uff0c\u90a3\u4e48\u8bf7\u624b\u52a8\u641c\u4e00\u4e0b\u3002Mac \u7528\u6237\u7684\u8bdd\u5728 homebrew \u91cc\u53ef\u4ee5\u5e94\u8be5\u90fd\u80fd\u627e\u5230\u3002<\/p>\n
\u867d\u7136\u8bf4\u987a\u5e8f\u5f88\u968f\u673a\u4f46\u8fd9\u4e00\u6761\u4e00\u5b9a\u5f97\u6392\u5728\u7b2c\u4e00\u4e2a\u3002\u5f88\u591a\u4eba\u7528 Linux \u7684\u72b6\u6001\u90fd\u662f\u81ea\u5df1\u7684\u673a\u5668\u662f Windows\uff0c\u7528 putty \u8fde\u5230\u4e00\u4e2a\u54ea\u91cc\u7684 Linux \u670d\u52a1\u5668\u8fdb\u884c\u5de5\u4f5c\u3002\u8fd9\u6837\u7684\u8bdd\u6bcf\u6b21\u65ad\u5f00\u7684\u65f6\u5019\u4f60\u8fd0\u884c\u7684\u7a0b\u5e8f\u90fd\u662f\u4f1a\u88ab\u6740\u6389\u7684\u3002\u4f60\u53ef\u80fd\u4f1a\u5e0c\u671b\u9000\u51fa\u7684\u65f6\u5019\u80fd\u628a\u6253\u5f00\u7684\u7a0b\u5e8f\u4fdd\u6301\u5728\u90a3\u91cc\uff0c\u4e0b\u6b21\u7528\u8fde\u63a5\u7684\u65f6\u5019\u53c8\u80fd\u81ea\u52a8\u5230\u4e4b\u524d\u7684\u5de5\u4f5c\u72b6\u6001\u3002tmux \u5c31\u662f\u8fd9\u4e2a\u95ee\u9898\u7684\u7ec8\u6781\u89e3\u51b3\u65b9\u6848\u3002\u5b83\u4eec\u4e00\u65b9\u9762\u7684\u529f\u80fd\u662f\u80fd\u5728\u4e00\u4e2a Terminal \u91cc\u521b\u5efa\u591a\u4e2a\u201c\u7a97\u53e3\u201d\uff0c\u53e6\u4e00\u65b9\u9762\u5982\u679c\u4f60\u5173\u95ed\u8fde\u63a5\u6216\u8005\u610f\u5916\u6389\u7ebf\uff0c\u5b83\u4eec\u9ed8\u8ba4\u4e5f\u4e0d\u4f1a\u5173\u6389\uff0c\u4e0b\u6b21\u8fde\u4e0a\u53bb\u53ef\u4ee5\u7528 tmux attach \u6765\u6062\u590d\u4f60\u4e4b\u524d\u7684\u5de5\u4f5c\u72b6\u6001\u3002<\/p>\n
\u5982\u679c\u4f60\u6ca1\u542c\u8bf4\u8fc7\u8fd9\u4e2a\u6216\u8005\u7c7b\u4f3c\u7684 screen \u7684\u8bdd\uff0c\u90a3\u4f60\u5e94\u8be5\u7ed9\u6211\u4e00\u70b9\u73b0\u91d1\u3002<\/p>\n
ls \u53ef\u80fd\u662f\u4f60\u6700\u5e38\u7528\u7684\u547d\u4ee4\u4e4b\u4e00\u3002tree \u53ef\u4ee5\u9012\u5f52\u7684\u5217\u51fa\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u6587\u4ef6\uff0c\u5e76\u4ee5\u6811\u72b6\u5f62\u5f0f\u5c55\u73b0\uff1a<\/p>\n
$ tree\r\n.\r\n\u251c\u2500\u2500 b\r\n\u251c\u2500\u2500 c\r\n\u2502 \u2514\u2500\u2500 d\r\n\u2514\u2500\u2500 what\r\n<\/pre>\n\u5bf9\u5e94\u7684\u4e5f\u6709 pstree \u53ef\u4ee5\u4ee5\u8fd9\u6837\u7684\u65b9\u5f0f\u6765\u663e\u793a\u8fdb\u7a0b\u6811\u3002<\/p>\n
ack<\/strong><\/span><\/div>\n\u6211\u8bb0\u5f97\u6211\u66fe\u7ecf\u5728\u9762\u8bd5\u7684\u65f6\u5019\u88ab\u95ee\u5230\u8fc7\u201c\u8bf7\u5199\u5982\u4f55\u8c03\u7528 grep \u6765\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u91cc\uff0c\u542b\u6709\u67d0\u4e2a\u5b57\u7b26\u4e32\u7684\u884c\u201d\u3002\u8fd9\u4e2a\u95ee\u9898\u6211\u7684\u56de\u7b54\u662f \u201c\u7528 ack \u5c31\u53ef\u4ee5\u4e86\u201d\u3002ack \u7684\u5b98\u7f51\u57df\u540d\u5c31\u53eb betterthangrep.com\u3002\u7531\u4e8e\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u8f7d\u6240\u6709\u6587\u4ef6\u91cc\u67e5\u627e\u67d0\u4e2a\u5b57\u4e32\u7b26\u662f\u5982\u6b64\u5e38\u89c1\u7684\u4e00\u4e2a\u64cd\u4f5c\uff0c\u6267\u884c ack foo \u5c31\u53ef\u4ee5\u5728\u5f53\u524d\u76ee\u5f55\u6240\u6709\u6587\u4ef6\u91cc\u67e5\u627e foo\u3002ack \u9ed8\u8ba4\u4f1a\u8df3\u8fc7\u5f88\u591a\u6ca1\u7528\u7684\u76ee\u5f55\u548c\u6587\u4ef6\uff0c\u8ba9\u67e5\u627e\u66f4\u5feb\uff0c\u8f93\u51fa\u7ed3\u679c\u66f4\u51c6\u786e\u3002\u53e6\u5916\u50cf\u9ed8\u8ba4\u5f00\u542f\u7684\u5f69\u8272\u663e\u793a\u4e5f\u8ba9\u4eba\u7528\u8d77\u6765\u5f88\u8212\u7545\u3002<\/p>\n
ack \u76ee\u524d\u5927\u90e8\u5206\u53d1\u884c\u7248\u4e2d\u6ca1\u6709\uff0c\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f Ubuntu \u7684\u8bdd\u5176\u5305\u88f9\u540d\u5b57\u662f ack-grep\uff0c\u6267\u884c\u6587\u4ef6\u7684\u540d\u5b57\u4e5f\u4e00\u6837\u3002\u5177\u4f53\u53ef\u4ee5\u5728\u8fd9\u91cc\u67e5\u770b\u6587\u6863\u3002<\/p>\n
rsync<\/strong><\/span><\/div>\n\u6bd4\u5982\u8bf4\u4f60\u672c\u5730\u6709\u4e00\u53f0\u7535\u8111\uff0c\u8fdc\u7a0b\u6709\u4e00\u53f0\u670d\u52a1\u5668\u3002\u4f60\u60f3\u628a\u4f60\u7684\u4e00\u4e2a\u6587\u4ef6\u5939\u5168\u90e8\u62f7\u8d1d\u5230\u53e6\u5916\u4e00\u8fb9\u7684\u67d0\u4e2a\u5730\u65b9\u53bb\u3002\u4f60\u8fd9\u4e2a\u6587\u4ef6\u5939\u7ecf\u5e38\u4e5f\u8981\u66f4\u65b0\uff0c\u5e0c\u671b\u901a\u8fc7\u67d0\u79cd\u65b9\u5f0f\u628a\u66f4\u65b0\u7684\u90e8\u5206\u80fd\u8fc5\u901f\u540c\u6b65\u8fc7\u53bb\u3002\u8fd9\u5e94\u8be5\u600e\u4e48\u505a\uff1f\u4e0d\u77e5\u9053 rsync \u7684\u8bdd\u4f60\u53ef\u80fd\u4f1a\u60f3\u7528 git\uff0c\u642d\u5efa\u4e00\u4e2a ftp\uff0c\u6216\u8005\u7528 scp \u6216\u8005\u522b\u7684\u3002\u4f46\u4e8b\u5b9e\u4e0a rsync \u624d\u662f\u771f\u6b63\u7684\u4e3a\u7cbe\u786e\u7684\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u800c\u751f\u7684\u8f6f\u4ef6\u3002rsync \u6700\u68d2\u7684\u5730\u65b9\u5c31\u662f\u5dee\u91cf\u66f4\u65b0\uff0c\u4e5f\u5c31\u662f\u53ea\u628a\u53e6\u5916\u4e00\u8fb9\u7f3a\u5c11\u7684\u4e1c\u897f\u4f20\u8fc7\u53bb\uff0c\u800c\u4e14\u4f60\u4e0d\u9700\u8981\u4efb\u4f55\u989d\u5916\u914d\u7f6e\uff0c\u901f\u5ea6\u5feb\u7684\u98de\u8d77\u3002\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n
< class=\"java\">rsync -arvuzp --chmod=g+rx .\/built\/ me