{"id":251788,"date":"2022-09-10T10:44:55","date_gmt":"2022-09-10T02:44:55","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=251788"},"modified":"2022-09-05T04:45:40","modified_gmt":"2022-09-04T20:45:40","slug":"absolute-relative-paths-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/absolute-relative-paths-linux.html","title":{"rendered":"\u6700\u6700\u57fa\u7840\u7684\u5e72\u8d27\uff1aLinux\u4e2d\u7684\u7edd\u5bf9\u8def\u5f84\u548c\u76f8\u5bf9\u8def\u5f84"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8def\u5f84\u662fLinux\u4e2d\u6700\u57fa\u672c\u7684\u6982\u5ff5\u4e4b\u4e00\uff0c\u8fd9\u662f\u6bcf\u4e2aLinux\u7528\u6237\u90fd\u5fc5\u987b\u77e5\u9053\u7684\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8def\u5f84\u662fLinux\u4e2d\u6700\u57fa\u672c\u7684\u6982\u5ff5\u4e4b\u4e00\uff0c\u8fd9\u662f\u6bcf\u4e2aLinux\u7528\u6237\u90fd\u5fc5\u987b\u77e5\u9053\u7684\u3002<\/p>\n

\u8def\u5f84\u662f\u6307\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5f15\u7528\u65b9\u5f0f\u3002\u5b83\u7ed9\u51fa\u4e86\u6587\u4ef6\u6216\u76ee\u5f55\u5728 Linux \u76ee\u5f55\u7ed3\u6784\u4e2d\u7684\u4f4d\u7f6e\uff0c\u7531\u540d\u79f0\u548c\u659c\u6760\u7ec4\u6210\u3002<\/p>\n

\r\n\/home\/abhishek\/scripts\r\n<\/pre>\n

\u4f5c\u4e3a\u4e00\u4e2a\u7cfb\u7edf\u7528\u6237\uff0c\u5f53\u60a8\u60f3\u8981\u8bbf\u95ee\u67d0\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\uff0c\u6216\u8005\u5fc5\u987b\u4e3a\u547d\u4ee4\u6216\u811a\u672c\u6307\u5b9a\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u4f4d\u7f6e\u65f6\uff0c\u5c31\u4f1a\u4f7f\u7528\u8def\u5f84\u3002<\/p>\n

\r\ncat \/home\/abhishek\/scripts\/my_script.sh\r\n<\/pre>\n

\u8bf7\u8bb0\u4f4f\uff0c\u5982\u679c\u8def\u5f84\u4ee5\u659c\u6760\u201c\/\u201d\u5f00\u5934\uff0c\u5219\u7b2c\u4e00\u4e2a\u659c\u6760\u8868\u793a\u6839\uff0c\u8def\u5f84\u4e2d\u7684\u5176\u4f59\u659c\u7ebf\u53ea\u662f\u5206\u9694\u7b26\u3002\u521d\u5b66\u8005\u7ecf\u5e38\u6df7\u6dc6\u6839\u659c\u6760\u548c\u5206\u9694\u7b26\u659c\u6760\u3002
\n\"\"
\n\u5728\u4e0a\u56fe\u4e2d\uff0c\u7b2c\u4e00\u4e2a\u8def\u5f84\u662f\u4ee5\u6839\u8def\u5f84\uff08\/\uff09\u5f00\u59cb\u7684\uff0c\u7b2c\u4e8c\u4e2a\u8def\u5f84\u4e0d\u662f\u4ee5 \/ \u5f00\u59cb\u7684\u3002\u8fd9\u4e24\u79cd\u5199\u6cd5\u90fd\u662f\u6b63\u786e\u7684\uff0c\u7b2c\u4e00\u4e2a\u662f\u7edd\u5bf9\u8def\u5f84\uff0c\u7b2c\u4e8c\u4e2a\u662f\u76f8\u5bf9\u8def\u5f84\u3002<\/p>\n

Linux\u4e2d\u7684\u7edd\u5bf9\u8def\u5f84\u548c\u76f8\u5bf9\u8def\u5f84<\/strong><\/div>\n

\u7edd\u5bf9\u8def\u5f84\u59cb\u7ec8\u4ece\u6839\u76ee\u5f55\uff08\/\uff09\u5f00\u59cb\uff0c\u6bd4\u5982\uff1a<\/p>\n

\r\n\/home\/abhishek\/scripts\/my_scripts.sh\r\n<\/pre>\n

\u76f8\u5bf9\u8def\u5f84\u4ece\u5f53\u524d\u76ee\u5f55\u5f00\u59cb\u3002\u6bd4\u5982\uff0c\u5982\u679c\u4f60\u5728 \/home \u76ee\u5f55\u4e2d\uff0c\u5e0c\u671b\u8bbf\u95ee my_script.sh \u6587\u4ef6\uff0c\u90a3\u4e48\u8bbf\u95ee\u7684\u8def\u5f84\u5e94\u8be5\u662f\uff1a<\/p>\n

\r\nabhishek\/scripts\/my_scripts.sh\r\n<\/pre>\n
\u7406\u89e3\u7edd\u5bf9\u8def\u5f84\u548c\u76f8\u5bf9\u8def\u5f84\u4e4b\u95f4\u7684\u5dee\u5f02<\/strong><\/div>\n

\u6211\u4eec\u90fd\u77e5\u9053Linux\u4e2d\u76ee\u5f55\u7ed3\u6784\u662f\u4e00\u4e2a\u6811\uff0c\u4ece\u6839\uff08\/\uff09\u5f00\u59cb\uff0c\u7136\u540e\u4ea7\u751f\u5206\u652f\u3002<\/p>\n

\u5047\u8bbe\u6211\u4eec\u73b0\u5728\u76ee\u5f55abhishek\u4e2d\uff0c\u5e76\u4e14\u5e0c\u671b\u8bbf\u95ee\u6587\u4ef6my_scripts.sh\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u4e24\u79cd\u8def\u5f84\u7684\u8868\u793a\uff1a<\/p>\n

\"\"<\/p>\n

\u5047\u8bbe\u6211\u4eec\u4f7f\u7528 ls \u547d\u4ee4\u67e5\u770b my_script.sh \u7684\u6587\u4ef6\u4fe1\u606f\uff0c\u90a3\u4e48\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff1a<\/p>\n

\r\nls -l \/home\/abhishek\/scripts\/my_script.sh\r\n<\/pre>\n

\u7136\u540e\uff0c\u76f8\u5bf9\u8def\u5f84\uff1a<\/p>\n

\r\nls -l scripts\/my_script.sh\r\n<\/pre>\n

\u90a3\u4e48\uff0c\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\uff0c\u9664\u4e86\u6587\u4ef6\u8def\u5f84\u4e0d\u4e00\u6837\u4ee5\u5916\uff0c\u5176\u4ed6\u7684\u5b8c\u5168\u4e00\u6837\uff1a<\/p>\n

\"\"<\/p>\n

\u6ce8\uff1a\u5728Linux\u4e2d\uff0c\u6587\u4ef6\u540d\u533a\u5206\u5927\u5c0f\u5199\u3002\u53ef\u4ee5\u6709\u5927\u5199\u3001\u5c0f\u5199\u3001\u6570\u5b57\u3001\u70b9\u3001\u4e2d\u5212\u7ebf\u3001\u4e0b\u5212\u7ebf\u4ee5\u53ca\u9664\u4e86\u659c\u6760\uff08\/\uff09\u4e4b\u5916\u7684\u5927\u591a\u6570\u5b57\u7b26\u3002\u659c\u6760\uff08\/\uff09\u4f5c\u4e3a\u4fdd\u7559\u5b57\u7b26\uff0c\u7528\u4e8e\u6839\u76ee\u5f55\u548c\u7528\u4e8e\u5206\u5272\u8def\u5f84\u4e2d\u7684\u76ee\u5f55\u3002<\/p>\n

\u4f7f\u7528\u5e26\u6709 . \u548c .. \u76ee\u5f55\u7684\u76f8\u5bf9\u8def\u5f84<\/p>\n

\u6709\u4e24\u79cd\u7279\u6b8a\u7684\u76f8\u5bf9\u8def\u5f84\uff1a<\/strong><\/div>\n
  • .\uff08\u4e00\u4e2a\u70b9\uff09\uff1a\u8868\u793a\u8def\u5f84\u4e2d\u7684\u5f53\u524d\u8def\u5f84\uff1b<\/li>\n
  • ..\uff08\u4e24\u4e2a\u70b9\uff09\uff1a\u8868\u793a\u7236\u76ee\u5f55\uff0c\u5373\u4e0a\u4e00\u7ea7\u76ee\u5f55\u3002<\/li>\n

    \u5982\u4e0b\u56fe\uff0c\u6211\u4eec\u8981\u4ece abhishek \u76ee\u5f55\u4e2d\uff0c\u5230 prakash \u76ee\u5f55\u4e2d\u53bb\u3002<\/p>\n

    \"\"<\/p>\n

    \u5207\u6362\u76ee\u5f55\uff0c\u4f7f\u7528 cd \u547d\u4ee4\u3002\u5982\u679c\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u53ef\u4ee5\u8fd9\u6837\uff1a<\/p>\n

    \r\ncd \/home\/prakash\r\n<\/pre>\n

    \u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u7684\u8bdd \uff0c\u9700\u8981\u7528\u5230\u7279\u6b8a\u7684\u76f8\u5bf9\u8def\u5f84 .. :<\/p>\n

    \r\ncd ..\/prakash\r\n<\/pre>\n

    \u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528 .. \u5462\uff1f\u56e0\u4e3a\u76f8\u5bf9\u8def\u5f84\u8981\u4ece\u5f53\u524d\u76ee\u5f55\u5f00\u59cb\uff0c\u6211\u4eec\u9700\u8981\u544a\u8bc9 cd \u547d\u4ee4\u5411\u4e0a\u4e00\u7ea7\uff0c\u5c06\u6211\u4eec\u5e26\u5230 \/home \u76ee\u5f55\uff0c\u7136\u540e\u4ece\u90a3\u91cc\u5728\u8fdb\u5165\u5230 prakash \u76ee\u5f55\u3002<\/p>\n

    \u7edd\u5bf9\u8def\u5f84\u59cb\u7ec8\u4ee5 \/ \u5f00\u59cb\uff0c\u5e76\u4e14\u4e0e\u5f53\u524d\u4f4d\u7f6e\u65e0\u5173\uff1b\u76f8\u5bf9\u8def\u5f84\u53d6\u51b3\u4e8e\u5f53\u524d\u7684\u4f4d\u7f6e\u3002<\/p>\n

    \u7edd\u5bf9\u8def\u5f84\u548c\u76f8\u5bf9\u8def\u5f84\uff0c\u5e94\u8be5\u4f7f\u7528\u54ea\u4e2a\u5462\uff1f<\/strong><\/div>\n

    \u8001\u5b9e\u8bf4\uff0c\u8fd9\u4e2a\u95ee\u9898\u6ca1\u6709\u76f4\u622a\u4e86\u5f53\u7684\u7b54\u6848\u3002\u8fd9\u8981\u89c6\u60c5\u51b5\u800c\u5b9a\u3002<\/p>\n

    \u5982\u679c\u4f60\u5f53\u524d\u6240\u5728\u7684\u76ee\u5f55\u5c42\u6b21\u7ed3\u6784\u6bd4\u8f83\u6df1\uff0c\u5e76\u4e14\u9700\u8981\u5411\u4e0a\u6216\u8005\u5411\u4e0b\u4e00\u7ea7\u79fb\u52a8\uff0c\u90a3\u4e48\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u4f1a\u66f4\u7b80\u5355\u3002<\/p>\n

    \u5047\u8bbe\u4f60\u4f4d\u4e8e<\/p>\n

    \/home\/username\/programming\/project\/interface\/src\/header \u76ee\u5f55\u4e2d\uff0c\u5e76\u4e14\u9700\u8981\u8bbf\u95ee \/home\/username\/programming\/project\/interface\/bin \u76ee\u5f55\u4e2d\u7684\u67d0\u4e9b\u5185\u5bb9\u3002\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u53ef\u4ee5\u907f\u514d\u952e\u5165\u6240\u6709\u5197\u957f\u7684\u76ee\u5f55\u540d\uff0c\u53ea\u9700\u5728\u6b64\u5904\u4f7f\u7528..\/.\/bin\u5373\u53ef\u3002<\/p>\n

    \u4f46\u662f\uff0c\u5982\u679c\u4f60\u8981\u4ece \/home\/username\/programming\/project\/interface\/src\/header\u76ee\u5f55\u8bbf\u95ee \/usr\/bin \u76ee\u5f55\u4e2d\u7684\u67d0\u4e9b\u5185\u5bb9\uff0c\u90a3\u4e48\u4f7f\u7528 ..\/..\/..\/..\/..\/..\/usr\/bin \u4f1a\u6bd4\u8f83\u9ebb\u70e6\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u66f4\u65b9\u4fbf\u3002<\/p>\n

    \u53e6\u4e00\u79cd\u60c5\u51b5\uff0c\u662f\u5728\u811a\u672c\u6216\u8005\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u8def\u5f84\u3002\u5982\u679c\u4f4d\u7f6e\u662f\u786e\u5b9a\u7684\uff0c\u90a3\u4e48\u5c31\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff1b\u5982\u679c\u9879\u76ee\u4e2d\u6709\u591a\u4e2a\u6587\u4ef6\u5939\uff0c\u5e76\u4e14\u9700\u8981\u5728\u5176\u4e2d\u4e4b\u95f4\u5207\u6362\uff0c\u90a3\u4e48\u6b64\u5904\u9700\u8981\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff0c\u56e0\u4e3a\u4f60\u4e0d\u786e\u5b9a\u6700\u7ec8\u7528\u6237\u4f1a\u5c06\u7a0b\u5e8f\u653e\u5728\u4ec0\u4e48\u5730\u65b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u8def\u5f84\u662fLinux\u4e2d\u6700\u57fa\u672c\u7684\u6982\u5ff5\u4e4b\u4e00\uff0c\u8fd9\u662f\u6bcf\u4e2aLinux\u7528\u6237\u90fd\u5fc5\u987b\u77e5\u9053\u7684\u3002 \u8def\u5f84\u662f\u6307\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5f15\u7528\u65b9\u5f0f\u3002\u5b83\u7ed9\u51fa […]<\/p>\n","protected":false},"author":1898,"featured_media":251795,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[911],"class_list":["post-251788","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-911"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/251788","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\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=251788"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/251788\/revisions"}],"predecessor-version":[{"id":251796,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/251788\/revisions\/251796"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/251795"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=251788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=251788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=251788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}