{"id":2030,"date":"2024-06-05T20:17:02","date_gmt":"2024-06-05T12:17:02","guid":{"rendered":"https:\/\/cn.raksmart.com\/blog\/host\/3796.html"},"modified":"2024-06-05T20:17:02","modified_gmt":"2024-06-05T12:17:02","slug":"linux-unix-%e8%be%93%e5%85%a5%e8%be%93%e5%87%ba%e9%87%8d%e5%ae%9a%e5%90%91%e4%b8%80","status":"publish","type":"post","link":"https:\/\/cn.raksmart.com\/blog\/knowledge\/jszc\/2030.html","title":{"rendered":"Linux\/Unix \u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411(\u4e00)"},"content":{"rendered":"<div class=\"entry-content e-content\" itemprop=\"description articleBody\">\n<p>\u91cd\u5b9a\u5411\u662f Linux \u4e2d\u7684\u4e00\u9879\u529f\u80fd\uff0c\u5f53\u6267\u884c\u547d\u4ee4\u65f6\uff0c\u60a8\u53ef\u4ee5\u66f4\u6539\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u3002\u4efb\u4f55 Linux \u547d\u4ee4\u7684\u57fa\u672c\u5de5\u4f5c\u6d41\u7a0b\u90fd\u662f\u63a5\u53d7\u8f93\u5165\u5e76\u7ed9\u51fa\u8f93\u51fa\u3002<a href=\"https:\/\/www.raksmart.com\/cps\/7821\" target=\"_blank\" rel=\"noopener\">raksmart<\/a><a href=\"https:\/\/cn.raksmart.com\/\" target=\"_blank\" rel=\"noopener\"><strong>\u9999\u6e2f\u670d\u52a1\u5668<\/strong><\/a>\u4e3a\u60a8\u5206\u4eabLinux\/Unix \u8f93\u5165\u8f93\u51fa\u91cd\u5b9a\u5411\uff1a<\/p>\n<p>\u6574\u7247\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u5b66\u4e60\u4e94\u4e2a\u4e3b\u8981\u6a21\u5757\uff0c\u5728\u8fd9\u4e00\u7bc7\u4e2d\u6211\u4eec\u5b66\u4e60\u201c\u8f93\u51fa\u91cd\u5b9a\u5411\u3001\u8f93\u5165\u91cd\u5b9a\u5411\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26 (FD)\u201d\u6a21\u5757\u3002\u63a8\u8350\u9605\u8bfb\uff1a<a href=\"https:\/\/cn.raksmart.com\/blog\/knowledge\/1658.html\" target=\"_blank\" rel=\"noopener\">\u300aLinux \u64cd\u4f5c\u7cfb\u7edf\u7b80\u4ecb\u300b<\/a><\/p>\n<p>\u8f93\u51fa\u91cd\u5b9a\u5411<\/p>\n<p>\u2018 &gt; \u2018 \u7b26\u53f7\u7528\u4e8e\u8f93\u51fa (STDOUT) \u91cd\u5b9a\u5411\u3002<\/p>\n<p>\u4f8b\u5b50\uff1a<\/p>\n<p>ls -al &gt; listings<\/p>\n<p>\u8fd9\u91cc\u547d\u4ee4 ls -al \u7684\u8f93\u51fa\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\u201c\u5217\u8868\u201d\u800c\u4e0d\u662f\u4f60\u7684\u5c4f\u5e55\u3002<\/p>\n<p>Linux\/Unix \u4e2d\u7684\u91cd\u5b9a\u5411\u2014\u2014\u63ed\u79d8!<\/p>\n<p>\u6ce8\u610f\uff1a\u5728\u5c06\u547d\u4ee4\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\u65f6\u4f7f\u7528\u6b63\u786e\u7684\u6587\u4ef6\u540d\u3002\u5982\u679c\u5b58\u5728\u540c\u540d\u6587\u4ef6\uff0c\u91cd\u5b9a\u5411\u547d\u4ee4\u5c06\u5220\u9664\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u7136\u540e\u53ef\u80fd\u4f1a\u88ab\u8986\u76d6\u3002\u201d<\/p>\n<p>\u5982\u679c\u60a8\u4e0d\u60f3\u8986\u76d6\u6587\u4ef6\u4f46\u60f3\u5411\u73b0\u6709\u6587\u4ef6\u6dfb\u52a0\u66f4\u591a\u5185\u5bb9\uff0c\u5219\u5e94\u4f7f\u7528\u201c&gt;&gt; \u201d\u8fd0\u7b97\u7b26\u3002<\/p>\n<p>\u60a8\u4e0d\u4ec5\u53ef\u4ee5\u5c06\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u8fd8\u53ef\u4ee5\u91cd\u5b9a\u5411\u5230\u8bbe\u5907!<\/p>\n<p>$ cat music.mp3 &gt; \/dev\/audio<\/p>\n<p>cat \u547d\u4ee4\u8bfb\u53d6\u6587\u4ef6 music.mp3 \u5e76\u5c06\u8f93\u51fa\u53d1\u9001\u5230 \/dev\/audio \u8fd9\u662f\u97f3\u9891\u8bbe\u5907\u3002\u5982\u679c\u60a8\u7684 PC \u4e2d\u7684\u58f0\u97f3\u914d\u7f6e\u6b63\u786e\uff0c\u6b64\u547d\u4ee4\u5c06\u64ad\u653e\u6587\u4ef6 music.mp3<\/p>\n<p>\u8f93\u5165\u91cd\u5b9a\u5411<\/p>\n<p>\u2018 &lt; \u2018 \u7b26\u53f7\u7528\u4e8e\u8f93\u5165(STDIN)\u91cd\u5b9a\u5411<\/p>\n<p>\u793a\u4f8b\uff1a Linux \u4e2d\u7684\u90ae\u4ef6\u7a0b\u5e8f\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4ece\u7ec8\u7aef\u53d1\u9001\u7535\u5b50\u90ae\u4ef6\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u8bbe\u5907\u952e\u76d8\u952e\u5165\u7535\u5b50\u90ae\u4ef6\u7684\u5185\u5bb9\u3002\u4f46\u662f\uff0c\u5982\u679c\u60a8\u60f3\u5c06\u6587\u4ef6\u9644\u52a0\u5230\u7535\u5b50\u90ae\u4ef6\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u683c\u5f0f\u7684\u8f93\u5165\u91cd\u5b9a\u5411\u8fd0\u7b97\u7b26\u3002\u63a8\u8350\u9605\u8bfb\uff1a<a href=\"https:\/\/cn.raksmart.com\/blog\/?s=Linux\" target=\"_blank\" rel=\"noopener\">\u300aLinux\u670d\u52a1\u5668\u4e2dCentOS\u3001Ubuntu\u3001Debian\u7cfb\u7edf\u6bd4\u8f83\u300b<\/a><\/p>\n<p>Mail -s \u201cSubject\u201d to-address &lt; Filename<\/p>\n<p>\u8fd9\u4f1a\u5c06\u6587\u4ef6\u4e0e\u7535\u5b50\u90ae\u4ef6\u4e00\u8d77\u9644\u52a0\uff0c\u5e76\u5c06\u5176\u53d1\u9001\u7ed9\u6536\u4ef6\u4eba\u3002<\/p>\n<p>\u4e0a\u9762\u7684\u4f8b\u5b50\u5f88\u7b80\u5355\u3002\u8ba9\u6211\u4eec\u770b\u4e00\u4e9b\u5229\u7528\u6587\u4ef6\u63cf\u8ff0\u7b26\u7684\u9ad8\u7ea7\u91cd\u5b9a\u5411\u6280\u672f\u3002<\/p>\n<p>\u6587\u4ef6\u63cf\u8ff0\u7b26 (FD)<\/p>\n<p>\u5728 Linux\/Unix \u4e2d\uff0c\u4e00\u5207\u90fd\u662f\u6587\u4ef6\u3002\u5e38\u89c4\u6587\u4ef6\u3001\u76ee\u5f55\uff0c\u751a\u81f3\u8bbe\u5907\u90fd\u662f\u6587\u4ef6\u3002\u6bcf\u4e2a\u6587\u4ef6\u90fd\u6709\u4e00\u4e2a\u5173\u8054\u7684\u7f16\u53f7\uff0c\u79f0\u4e3a\u6587\u4ef6\u63cf\u8ff0\u7b26 (FD)\u3002<\/p>\n<p>\u60a8\u7684\u5c4f\u5e55\u4e5f\u6709\u4e00\u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002\u6267\u884c\u7a0b\u5e8f\u65f6\uff0c\u8f93\u51fa\u5c06\u53d1\u9001\u5230\u5c4f\u5e55\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u60a8\u53ef\u4ee5\u5728\u76d1\u89c6\u5668\u4e0a\u770b\u5230\u7a0b\u5e8f\u8f93\u51fa\u3002\u5982\u679c\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6253\u5370\u673a\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u5219\u7a0b\u5e8f\u8f93\u51fa\u5c06\u88ab\u6253\u5370\u3002<\/p>\n<p>\u4ee5\u4e0a\u4e09\u4e2a\u6a21\u5757\u8bb2\u89e3\u5b8c\u6210\uff0c\u4e0b\u4e00\u7ae0\u6211\u4eec\u8bb2\u89e3\u201c\u9519\u8bef\u91cd\u5b9a\u5411\u3001\u4e3a\u4ec0\u4e48\u9519\u8bef\u91cd\u5b9a\u5411?\u201d\u4e24\u4e2a\u6a21\u5757\u3002\u63a8\u8350\u76f8\u5173\u9605\u8bfb\uff1a<a href=\"https:\/\/cn.raksmart.com\/blog\/server\/2026.html\">\u300aLinux\u670d\u52a1\u5668\u4e2dCentOS\u3001Ubuntu\u3001Debian\u7cfb\u7edf\u6bd4\u8f83\u300b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u5b9a\u5411\u662f Linux \u4e2d\u7684\u4e00\u9879\u529f\u80fd\uff0c\u5f53\u6267\u884c\u547d\u4ee4\u65f6\uff0c\u60a8\u53ef\u4ee5\u66f4\u6539\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u3002\u4efb\u4f55 Linux \u547d\u2026 <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[738,739],"class_list":["post-2030","post","type-post","status-publish","format-standard","hentry","category-jszc","tag-linux","tag-unix"],"_links":{"self":[{"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/posts\/2030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/comments?post=2030"}],"version-history":[{"count":0,"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/posts\/2030\/revisions"}],"wp:attachment":[{"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/media?parent=2030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/categories?post=2030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.raksmart.com\/blog\/wp-json\/wp\/v2\/tags?post=2030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}