{"id":1465,"date":"2023-12-01T09:22:21","date_gmt":"2023-12-01T01:22:21","guid":{"rendered":"https:\/\/blog.ttwow.top\/?p=1465"},"modified":"2026-06-19T21:21:55","modified_gmt":"2026-06-19T13:21:55","slug":"linux%e5%88%9b%e5%bb%ba%e6%96%87%e4%bb%b6%e7%9a%845%e7%a7%8d%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/blog.ttwow.top\/?p=1465","title":{"rendered":"Linux\u521b\u5efa\u6587\u4ef6\u76845\u79cd\u65b9\u5f0f"},"content":{"rendered":"<p>\u8f6c\u8f7d\uff1a<a href=\"https:\/\/blog.csdn.net\/xtho62\/article\/details\/118194873\">https:\/\/blog.csdn.net\/xtho62\/article\/details\/118194873<\/a><\/p>\n<h2>1 touch<\/h2>\n<p>touch\u6307\u4ee4\uff0c\u5f88\u5e38\u7528\u7684\u4e00\u79cd\u65b9\u6cd5<\/p>\n<h3>1.1 \u521b\u5efa\u4e00\u4e2a\u6587\u4ef6<\/h3>\n<p>touch yyTest.ini<\/p>\n<h3>1.2 \u540c\u65f6\u521b\u5efa\u4e24\u4e2a\u6587\u4ef6<\/h3>\n<p>touch test1.txt test2.txt<\/p>\n<h3>1.3 \u6279\u91cf\u521b\u5efa\u6587\u4ef6\uff08\u5982\u521b\u5efa2000\u4e2a\u6587\u4ef6\uff09<\/h3>\n<p>touch test{0001\u20262000}.txt<\/p>\n<h3>1.4 \u66f4\u6539\u6587\u4ef6 yyTest.ini\u65f6\u95f4\u4e3a\u5f53\u524d\u65f6\u95f4\uff08yyTest.ini\u5df2\u5b58\u5728\uff09<\/h3>\n<p>touch yyTest.ini<\/p>\n<h2>2 vi\u548cvim<\/h2>\n<p>vi test.txt<\/p>\n<p>vim touch.txt<\/p>\n<p>vi\u548cvim\u8fd8\u662f\u5f88\u5f3a\u5927\u7684\u3002<\/p>\n<h2>3 \u4f7f\u7528&gt;\u3001&gt;&gt;<\/h2>\n<h3>3.1  &gt;<\/h3>\n<p>\u76f4\u63a5\u8986\u76d6\u539f\u6587\u4ef6\uff0c\u4e0d\u4f1a\u6709\u4efb\u4f55\u63d0\u793a<\/p>\n<h3>3.2  &gt;&gt;<\/h3>\n<p>\u8ffd\u52a0\u5728\u539f\u6587\u4ef6\u672b\u5c3e\uff0c\u4e0d\u4f1a\u8986\u76d6\u539f\u6587\u4ef6\u7684\u5185\u5bb9<\/p>\n<h3>3.3 \u76f4\u63a5\u7528&gt;\u521b\u5efa\u7a7a\u6587\u4ef6<\/h3>\n<blockquote>\n<p>test.ini<\/p>\n<\/blockquote>\n<h3>3.4 ls \u521b\u5efa\u6587\u4ef6\uff08\u5c06\u7ed3\u679c\u5199\u5165\u6587\u4ef6\uff09<\/h3>\n<p>ls &gt; test.ini<\/p>\n<p>ls &gt;&gt; test.ini<\/p>\n<h3>3.5 grep \u521b\u5efa\u6587\u4ef6\uff08\u5c06\u7ed3\u679c\u5199\u5165\u6587\u4ef6\uff09<\/h3>\n<p>ps -ef | grep java &gt;test.ini<\/p>\n<p>ps -ef | grep java &gt;&gt;test.ini<\/p>\n<h3>3.6 echo \u521b\u5efa\u6587\u4ef6\uff08\u5c06\u7ed3\u679c\u5199\u5165\u6587\u4ef6\uff09<\/h3>\n<p>echo $PATH &gt; test.ini<\/p>\n<p>echo $PATH &gt;&gt; test.ini<\/p>\n<h2>4 \u4f7f\u7528cp\u521b\u5efa\u6587\u4ef6<\/h2>\n<p>\u53ea\u8981\u76ee\u6807\u6587\u4ef6\u662f\u65b0\u6587\u4ef6\u5219\u7b97\u521b\u5efa\u6587\u4ef6\uff0ccp\u8be6\u7ec6\u547d\u4ee4\u89e3\u8bfb\u53ef\u770b\u6b64\u535a\u6587\uff1a<a href=\"https:\/\/www.cnblogs.com\/poloyy\/p\/12514389.html\">https:\/\/www.cnblogs.com\/poloyy\/p\/12514389.html<\/a><\/p>\n<h2>5 \u4f7f\u7528cat\u521b\u5efa\u6587\u4ef6<\/h2>\n<h3>5.1 \u7b80\u5355\u4f7f\u7528&gt;\u3001&gt;&gt;<\/h3>\n<p>cat &gt; test.ini<\/p>\n<p>cat &gt;&gt; test.ini<\/p>\n<p>\u5176\u5b9e\u7528\u7684\u4e5f\u662f &gt; \u548c &gt;&gt; \uff0c\u4f46\u662f\u6709\u4e00\u70b9\u4e0d\u4e00\u6837\u7684\u662f\uff0c\u6572\u5b8c\u4e0a\u8ff0\u547d\u4ee4\u4f1a\u8fdb\u5165 test.ini \u7684\u7f16\u8f91\u6a21\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u4f60\u60f3\u8981\u5199\u5165\u7684\u5185\u5bb9\uff0c\u6700\u540e\u6309ctrl+z\u9000\u51fa\u7f16\u8f91\u6a21\u5f0f\u81ea\u52a8\u4fdd\u5b58<\/p>\n<h3>5.2 cat\u7ed3\u5408eof<\/h3>\n<pre><code class=\"language-shell\">cat &gt;&gt; test.ini &lt;&lt;eof\n\n2\n\n2\n\n2\n\neof<\/code><\/pre>\n<p>eof\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u5206\u754c\u7b26\uff0c\u9047\u5230\u4e0b\u4e00\u4e2a\u5206\u754c\u7b26\u65f6\u505c\u6b62\u8f93\u5165\uff1b\u5927\u5c0f\u5199\u4e00\u6837\u7684\u54e6<\/p>\n<h3>5.3 cat\u7ed3\u5408exit<\/h3>\n<pre><code class=\"language-shell\">\u548ceof\u540c\u7406 \n\ncat &gt;&gt; test.ini &lt;&lt;exit\n\n1\n\n1\n\nexit<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1ahttps:\/\/blog.csdn.net\/xtho62\/article\/details\/1181948 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130],"tags":[52],"class_list":["post-1465","post","type-post","status-publish","format-standard","hentry","category-linux-ops","tag-linux"],"_links":{"self":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/1465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1465"}],"version-history":[{"count":4,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/1465\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/1465\/revisions\/1469"}],"wp:attachment":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}