{"id":57985,"date":"2023-07-09T22:26:13","date_gmt":"2023-07-09T14:26:13","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=57985"},"modified":"2023-07-09T22:26:13","modified_gmt":"2023-07-09T14:26:13","slug":"linux-cd-command","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-cd-command.html","title":{"rendered":"15\u4e2a\u5173\u4e8eLinux\u7684\u2018cd\u2019\u547d\u4ee4\u7684\u7ec3\u4e60\u4f8b\u5b50"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728Linux\u4e2d\uff08\u6539\u53d8\u76ee\u5f55\uff09\u547d\u4ee4\uff0c\u662f\u5bf9\u65b0\u624b\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6765\u8bf4\uff0c\u6700\u91cd\u8981\u6700\u5e38\u7528\u7684\u547d\u4ee4\u3002\u5bf9\u7ba1\u7406\u65e0\u56fe\u5f62\u754c\u9762\u7684\u670d\u52a1\u5668\u7684\u7ba1\u7406\u5458\"cd\";\u662f\u8fdb\u5165\u76ee\u5f55\uff0c\u68c0\u67e5\u65e5\u5fd7\uff0c\u6267\u884c\u7a0b\u5e8f\/\u5e94\u7528\u8f6f\u4ef6\/\u811a\u672c\u548c\u5176\u4f59\u6bcf\u4e2a\u4efb\u52a1\u7684\u552f\u4e00\u65b9\u6cd5\u3002\u5bf9\u65b0\u624b\u6765\u8bf4\uff0c\u662f\u4ed6\u4eec\u5fc5\u987b\u81ea\u5df1\u52a8\u624b\u5b66\u4e60\u7684\u6700\u521d\u59cb\u547d\u4ee4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u6240\u4ee5\uff0c\u8bf7\u7528\u5fc3\u5b66\u4e60\uff0c\u6211\u4eec\u5728\u8fd9\u4f1a\u5e26\u7ed9\u4f6015\u4e2a\u57fa\u7840\u7684‘cd‘\u547d\u4ee4\uff0c\u5b83\u4eec\u5bcc\u6709\u6280\u5de7\u548c\u6377\u5f84\uff0c\u5b66\u4f1a\u4f7f\u7528\u8fd9\u4e9b\u4e86\u89e3\u5230\u7684\u6280\u5de7\uff0c\u4f1a\u5927\u5927\u51cf\u5c11\u4f60\u5728\u7ec8\u7aef\u4e0a\u82b1\u8d39\u7684\u52aa\u529b\u548c\u65f6\u95f4<\/p>\n

\u8bfe\u7a0b\u5185\u5bb9<\/strong><\/div>\n
  • \u547d\u4ee4\u540d\u79f0\uff1acd<\/li>\n
  • \u4ee3\u8868\uff1a\u5207\u6362\u76ee\u5f55<\/li>\n
  • \u4f7f\u7528\u5e73\u53f0\uff1a\u6240\u6709Linux\u53d1\u884c\u7248\u672c<\/li>\n
  • \u6267\u884c\u65b9\u5f0f\uff1a\u547d\u4ee4\u884c<\/li>\n
  • \u6743\u9650\uff1a\u8bbf\u95ee\u81ea\u5df1\u7684\u76ee\u5f55\u6216\u8005\u5176\u4f59\u6307\u5b9a\u76ee\u5f55<\/li>\n
  • \u7ea7\u522b\uff1a\u57fa\u7840\/\u521d\u5b66\u8005<\/li>\n
    1.\u4ece\u5f53\u524d\u76ee\u5f55\u5207\u6362\u5230\/usr\/local<\/strong><\/span><\/div>\n
    avi@tecmint:~$ cd \/usr\/local\r\navi@tecmint:\/usr\/local$\r\n<\/pre>\n
    2.\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u4ece\u5f53\u524d\u76ee\u5f55\u5207\u6362\u5230\/usr\/local\/lib<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local$ cd \/usr\/local\/lib\r\navi@tecmint:\/usr\/local\/lib$\r\n<\/pre>\n
    3.\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff0c\u4ece\u5f53\u524d\u8def\u5f84\u5207\u6362\u5230\/usr\/local\/lib<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local$ cd lib\r\navi@tecmint:\/usr\/local\/lib$\r\n<\/pre>\n
    4.\uff08a\uff09\u5207\u6362\u5f53\u524d\u76ee\u5f55\u5230\u4e0a\u4e00\u4e2a\u76ee\u5f55<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local\/lib$ cd -\r\n\/usr\/local\r\navi@tecmint:\/usr\/local$\r\n<\/pre>\n
    4.\uff08b\uff09\u5207\u6362\u5f53\u524d\u76ee\u5f55\u5230\u4e0a\u7ea7\u76ee\u5f55<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local\/lib$ cd ..\r\navi@tecmint:\/usr\/local$\r\n<\/pre>\n
    5.\u663e\u793a\u6211\u4eec\u6700\u540e\u4e00\u4e2a\u79bb\u5f00\u7684\u5de5\u4f5c\u76ee\u5f55<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local$ cd --\r\n\/home\/avi\r\n<\/pre>\n
    6.\u4ece\u5f53\u524d\u76ee\u5f55\u5411\u4e0a\u7ea7\u8fd4\u56de\u4e24\u5c42<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local$ cd ..\/..\/\r\navi@tecmint:\/$\r\n<\/pre>\n
    7.\u4ece\u4efb\u4f55\u76ee\u5f55\u8fd4\u56de\u5230\u7528\u6237home\u76ee\u5f55<\/strong><\/span><\/div>\n
    avi@tecmint:\/usr\/local$ cd ~\r\navi@tecmint:~$\r\n<\/pre>\n

    \u6216<\/p>\n

    avi@tecmint:\/usr\/local$ cd\r\navi@tecmint:~$\r\n<\/pre>\n
    8.\u5207\u6362\u5de5\u4f5c\u76ee\u5f55\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/strong><\/span><\/div>\n
    avi@tecmint:~\/Downloads$ cd .\r\navi@tecmint:~\/Downloads$\r\n<\/pre>\n

    \u6216<\/p>\n

    avi@tecmint:~\/Downloads$ cd .\/\r\navi@tecmint:~\/Downloads$\r\n<\/pre>\n
    9.\u8981\u6c42\u4e00\u884c\u547d\u4ee4\u5207\u6362<\/strong><\/span><\/div>\n

    \u4f60\u5f53\u524d\u76ee\u5f55\u662f“\/usr\/local\/lib\/python3.4\/dist-packages”\uff0c\u73b0\u5728\u8981\u5207\u6362\u5230“\/home\/avi\/Desktop\/”\uff0c\u8981\u6c42\uff1a\u4e00\u884c\u547d\u4ee4\uff0c\u901a\u8fc7\u5411\u4e0a\u4e00\u76f4\u5207\u6362\u76f4\u5230‘\/’\uff0c\u7136\u540e\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84<\/p>\n

    avi@tecmint:\/usr\/local\/lib\/python3.4\/dist-packages$ cd ..\/..\/..\/..\/..\/home\/avi\/Desktop\/\r\navi@tecmint:~\/Desktop$\r\n<\/pre>\n
    10.\u8981\u6c42\u7528TAB<\/strong><\/span><\/div>\n

    \u4ece\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u5207\u6362\u5230\/var\/www\/html\uff0c\u8981\u6c42\uff1a\u4e0d\u8981\u5c06\u547d\u4ee4\u6253\u5b8c\u6574\uff0c\u4f7f\u7528TAB<\/p>\n

    avi@tecmint:\/var\/www$ cd \/v<TAB>\/w<TAB>\/h<TAB>\r\navi@tecmint:\/var\/www\/html$\r\n<\/pre>\n
    11.\u5fd8\u8bb0\u76ee\u5f55\u540d\u5b57<\/strong><\/span><\/div>\n

    \u4ece\u5f53\u524d\u76ee\u5f55\u5207\u6362\u5230\/etc\/v__ _\uff0c\u554a\u5440\uff0c\u4f60\u7adf\u7136\u5fd8\u4e86\u76ee\u5f55\u7684\u540d\u5b57\uff0c\u4f46\u662f\u4f60\u53c8\u4e0d\u60f3\u7528TAB<\/p>\n

    avi@tecmint:~$ cd \/etc\/v*\r\navi@tecmint:\/etc\/vbox$\r\n<\/pre>\n

    \u8bf7\u6ce8\u610f\uff1a<\/strong>\u5982\u679c\u53ea\u6709\u4e00\u4e2a\u76ee\u5f55\u4ee5‘v<\/strong>‘\u5f00\u5934\uff0c\u8fd9\u5c06\u4f1a\u79fb\u52a8\u5230‘vbox<\/strong>‘\u3002\u5982\u679c\u6709\u5f88\u591a\u76ee\u5f55\u4ee5‘v<\/strong>‘\u5f00\u5934\uff0c\u800c\u4e14\u547d\u4ee4\u884c\u4e2d\u6ca1\u6709\u63d0\u4f9b\u66f4\u591a\u7684\u6807\u51c6\uff0c\u8fd9\u5c06\u4f1a\u79fb\u52a8\u5230\u7b2c\u4e00\u4e2a\u4ee5‘v<\/strong>‘\u5f00\u5934\u7684\u76ee\u5f55\uff08\u6309\u7167\u4ed6\u4eec\u5728\u6807\u51c6\u5b57\u5178\u91cc\u5b57\u6bcd\u5b58\u5728\u7684\u987a\u5e8f\uff09<\/p>\n

    12.\u5207\u6362\u60f3\u8981\u7684\u7528\u6237<\/strong><\/span><\/div>\n

    \u4f60\u60f3\u5207\u6362\u5230\u7528\u6237‘av<\/strong>‘\uff08\u4e0d\u786e\u5b9a\u662favi\u8fd8\u662favt\uff09\u76ee\u5f55\uff0c\u4e0d\u7528TAB<\/strong><\/p>\n

    avi@tecmint:\/etc$ cd \/home\/av?\r\navi@tecmint:~$\r\n<\/pre>\n
    13.Linux\u4e0b\u7684pushed\u548cpoped<\/strong><\/span><\/div>\n

    Pushed\u548cpoped\u662fLinux bash\u547d\u4ee4\uff0c\u4e5f\u662f\u5176\u4ed6\u51e0\u4e2a\u80fd\u591f\u4fdd\u5b58\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4f4d\u7f6e\u81f3\u5185\u5b58\uff0c\u5e76\u4e14\u4ece\u5185\u5b58\u8bfb\u53d6\u76ee\u5f55\u4f5c\u4e3a\u5f53\u524d\u76ee\u5f55\u7684\u811a\u672c\uff0c\u8fd9\u4e9b\u811a\u672c\u4e5f\u53ef\u4ee5\u5207\u6362\u76ee\u5f55<\/p>\n

    avi@tecmint:~$ pushd \/var\/www\/html\r\n\/var\/www\/html ~\r\navi@tecmint:\/var\/www\/html$ \r\n<\/pre>\n

    \u4e0a\u9762\u7684\u547d\u4ee4\u4fdd\u5b58\u5f53\u524d\u76ee\u5f55\u5230\u5185\u5b58\uff0c\u7136\u540e\u5207\u6362\u5230\u8981\u6c42\u7684\u76ee\u5f55\u3002\u4e00\u65e6poped\u88ab\u6267\u884c\uff0c\u5b83\u4f1a\u4ece\u5185\u5b58\u53d6\u51fa\u4fdd\u5b58\u7684\u76ee\u5f55\u4f4d\u7f6e\uff0c\u4f5c\u4e3a\u5f53\u524d\u76ee\u5f55<\/p>\n

    avi@tecmint:\/var\/www\/html$ popd\r\n~\r\navi@tecmint:~$\r\n<\/pre>\n
    14.\u5207\u6362\u5230\u540d\u5b57\u5e26\u6709\u7a7a\u683c\u7684\u76ee\u5f55<\/strong><\/span><\/div>\n
    avi@tecmint:~$ cd test\/ tecmint\/\r\navi@tecmint:~\/test tecmint$\r\n<\/pre>\n

    \u6216<\/p>\n

    avi@tecmint:~$ cd 'test tecmint'\r\navi@tecmint:~\/test tecmint$\r\n<\/pre>\n

    \u6216<\/p>\n

    avi@tecmint:~$ cd \"test tecmint\"\/\r\navi@tecmint:~\/test tecmint$\r\n<\/pre>\n
    15.\u5207\u6362\u5e76\u663e\u793a\u51fa\u6765<\/strong><\/span><\/div>\n

    \u4ece\u5f53\u524d\u76ee\u5f55\u5207\u6362\u5230\u4e0b\u8f7d\u76ee\u5f55\uff0c\u7136\u540e\u5217\u51fa\u5b83\u6240\u5305\u542b\u7684\u5185\u5bb9\uff08\u4f7f\u7528\u4e00\u884c\u547d\u4ee4\uff09<\/p>\n

    avi@tecmint:\/usr$ cd ~\/Downloads && ls\r\n...\r\n.\r\nservice_locator_in.xls\r\nsources.list\r\nteamviewer_linux_x64.deb\r\ntor-browser-linux64-3.6.3_en-US.tar.xz\r\n.\r\n...\r\n<\/pre>\n

    \u6211\u4eec\u5c1d\u8bd5\u4f7f\u7528\u6700\u5c11\u7684\u8bcd\u53e5\u548c\u4e00\u5982\u65e2\u5f80\u7684\u53cb\u597d\uff0c\u6765\u8ba9\u4f60\u4e86\u89e3Linux\u7684\u5de5\u4f5c\u548c\u6267\u884c\u3002<\/p>\n

    \u8fd9\u5c31\u662f\u6240\u6709\u5185\u5bb9\u3002\u6211\u5f88\u5feb\u4f1a\u5e26\u7740\u53e6\u4e00\u4e2a\u6709\u8da3\u7684\u4e3b\u9898\u56de\u6765\u7684\u3002<\/p>\n


    \n

    via: http:\/\/www.tecmint.com\/cd-command-in-linux\/<\/a><\/p>\n

    \u4f5c\u8005\uff1aAvishek Kumar<\/a> \u8bd1\u8005\uff1asu-kaiyao<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n

    \u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7ffb\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n

    \n

    \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-3881-1.html<\/a><\/p>\n

    \u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/linux-cd-command.html<\/a>\u7f16\u8f91\uff1a\u5f20@\u5b87\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

    \u5728Linux\u4e2d\uff0c‘cd‘\uff08\u6539\u53d8\u76ee\u5f55\uff09\u547d\u4ee4\uff0c\u662f\u5bf9\u65b0\u624b\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6765\u8bf4\uff0c\u6700\u91cd\u8981\u6700\u5e38\u7528\u7684\u547d\u4ee4\u3002\u5bf9\u7ba1\u7406\u65e0\u56fe\u5f62\u754c\u9762\u7684\u670d\u52a1\u5668\u7684\u7ba1\u7406\u5458\uff0c‘cd‘\u662f\u8fdb\u5165\u76ee\u5f55\uff0c\u68c0\u67e5\u65e5\u5fd7\uff0c\u6267\u884c\u7a0b\u5e8f\/\u5e94\u7528\u8f6f\u4ef6\/\u811a\u672c\u548c\u5176\u4f59\u6bcf\u4e2a\u4efb\u52a1\u7684\u552f\u4e00\u65b9\u6cd5\u3002\u5bf9\u65b0\u624b\u6765\u8bf4\uff0c\u662f\u4ed6\u4eec\u5fc5\u987b\u81ea\u5df1\u52a8\u624b\u5b66\u4e60\u7684\u6700\u521d\u59cb\u547d\u4ee4<\/p>\n","protected":false},"author":310,"featured_media":58116,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-57985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/57985","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\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=57985"}],"version-history":[{"count":16,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/57985\/revisions"}],"predecessor-version":[{"id":276964,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/57985\/revisions\/276964"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/58116"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=57985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=57985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=57985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}