{"id":269841,"date":"2023-04-19T20:21:50","date_gmt":"2023-04-19T12:21:50","guid":{"rendered":"https:\/\/gulass.cn\/qszwlrhzqpdw.html"},"modified":"2023-04-19T20:21:50","modified_gmt":"2023-04-19T12:21:50","slug":"qszwlrhzqpdw","status":"publish","type":"post","link":"https:\/\/gulass.cn\/qszwlrhzqpdw.html","title":{"rendered":"\u8f7b\u677e\u638c\u63e1Linux\uff1a\u5982\u4f55\u51c6\u786e\u5224\u65ad\u6587\u4ef6\u5b58\u5728\uff1f"},"content":{"rendered":"

\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\uff0c\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u662f\u4e00\u9879\u57fa\u672c\u64cd\u4f5c\u3002\u4f46\u662f\uff0c\u5bf9\u4e8e\u521d\u5b66\u8005\u6765\u8bf4\uff0c\u8fd9\u53ef\u80fd\u662f\u4e00\u4e2a\u6bd4\u8f83\u68d8\u624b\u7684\u95ee\u9898\u3002\u90a3\u4e48linux\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728<\/strong>\uff0c\u5982\u4f55\u5feb\u901f\u51c6\u786e\u5730\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u5462\uff1f\u63a5\u4e0b\u6765\uff0c\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e2a\u95ee\u9898\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u5e38\u7528\u7684\u89e3\u51b3\u65b9\u6cd5\u3002<\/p>\n

\u65b9\u6848\u4e00\uff1a\u4f7f\u7528\u201ctest\u201d\u547d\u4ee4<\/b><\/p>\n

test\u547d\u4ee4\u662f\u547d\u4ee4<\/a>\u7528\u4e8e\u68c0\u67e5\u6587\u4ef6\u7c7b\u578b\u548c\u6bd4\u8f83\u503c\u7684Shell\u5185\u7f6e\u547d\u4ee4\u3002\u5b83\u975e\u5e38\u9002\u5408\u7528\u4e8e\u5728Shell\u811a\u672c\u4e2d\u8fdb\u884c\u6761\u4ef6\u6d4b\u8bd5\u3002\u5728\u4f7f\u7528test\u547d\u4ee4\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nif test -e\u6587\u4ef6\u540d\nthen\n   echo "\u6587\u4ef6\u5b58\u5728"\nelse\n   echo "\u6587\u4ef6\u4e0d\u5b58\u5728"\nfi\n<\/pre>\n<\/p>\n

\u5176\u4e2d\uff0c-e\u53c2\u6570\u8868\u793a\u68c0\u67e5\u6240\u6307\u5b9a\u7684\u6587\u4ef6\u6216\u76ee\u5f55\u662f\u5426\u5b58\u5728\u3002<\/p>\n

\u65b9\u6848\u4e8c\uff1a\u4f7f\u7528\u201c[]\u201d\u7b26\u53f7<\/b><\/p>\n

\u9664\u4e86test\u547d\u4ee4\u4e4b\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u201c[]\u201d\u7b26\u53f7\u6765\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

\n

\nif [-e\u6587\u4ef6\u540d]\nthen\n   echo "\u6587\u4ef6\u5b58\u5728"\nelse\n   echo "\u6587\u4ef6\u4e0d\u5b58\u5728"\nfi\n<\/pre>\n<\/p>\n

\u6ce8\u610f\uff0c\u5728\u8fd9\u79cd\u65b9\u5f0f\u4e2d\uff0c\u201c[]\u201d\u7b26\u53f7\u548c\u53c2\u6570\u4e4b\u95f4\u5fc5\u987b\u6709\u7a7a\u683c\u3002<\/p>\n

\u65b9\u6848\u4e09\uff1a\u4f7f\u7528\u201c-f\u201d\u53c2\u6570<\/b><\/p>\n

\u5982\u679c\u4f60\u53ea\u9700\u8981\u5224\u65ad\u4e00\u4e2a\u666e\u901a\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u201c-f\u201d\u53c2\u6570\u3002\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

\n

\nif [-f\u6587\u4ef6\u540d]\nthen\n   echo "\u6587\u4ef6\u5b58\u5728"\nelse\n   echo "\u6587\u4ef6\u4e0d\u5b58\u5728"\nfi\n<\/pre>\n<\/p>\n

\u65b9\u6848\u56db\uff1a\u4f7f\u7528\u201c-d\u201d\u53c2\u6570<\/b><\/p>\n

\u5982\u679c\u4f60\u9700\u8981\u5224\u65ad\u4e00\u4e2a\u76ee\u5f55\u662f\u5426\u5b58\u5728\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u201c-d\u201d\u53c2\u6570\u3002\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

\n

\nif [-d\u76ee\u5f55\u540d]\nthen\n   echo "\u76ee\u5f55\u5b58\u5728"\nelse\n   echo "\u76ee\u5f55\u4e0d\u5b58\u5728"\nfi\n<\/pre>\n<\/p>\n

\u65b9\u6848\u4e94\uff1a\u4f7f\u7528\u201cls\u201d\u547d\u4ee4<\/b><\/p>\n

\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\u4e4b\u5916linux\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728<\/strong>\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u201cls\u201d\u547d\u4ee4\u6765\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

\n

\nif ls \u6587\u4ef6\u540d&>\/dev\/null\nthen\n   echo "\u6587\u4ef6\u5b58\u5728"\nelse\n   echo "\u6587\u4ef6\u4e0d\u5b58\u5728"\nfi\n<\/pre>\n<\/p>\n

\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2d\uff0c\u201c&>\/dev\/null\u201d\u8868\u793a\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u7a7a\u8bbe\u5907\u4e0aqq for linux\uff0c\u4ee5\u907f\u514d\u8f93\u51fa\u5e72\u6270\u3002<\/p>\n

\u65b9\u6848\u516d\uff1a\u4f7f\u7528\u201cfind\u201d\u547d\u4ee4<\/b><\/p>\n

android\u4e0b\u8f7d\u6587\u4ef6 \u5224\u65ad\u6587\u4ef6\u662f\u5426\u4e3a\u7a7a_linux\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728_gson\u5224\u65ad\u5b57\u6bb5\u5b58\u4e0d\u5b58\u5728<\/p>\n

\u6700\u540e\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u201cfind\u201d\u547d\u4ee4\u6765\u67e5\u627e\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

\n

\nif find \u6587\u4ef6\u540d&>\/dev\/null\nthen\n   echo "\u6587\u4ef6\u5b58\u5728"\nelse\n   echo "\u6587\u4ef6\u4e0d\u5b58\u5728"\nfi\n<\/pre>\n<\/p>\n

\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2dlinux\u7cfb\u7edf\u5b89\u88c5\u6559\u7a0b\uff0c\u201c&>\/dev\/null\u201d\u540c\u6837\u8868\u793a\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u7a7a\u8bbe\u5907\u4e0a\u3002<\/p>\n

\u901a\u8fc7\u4ee5\u4e0a\u516d\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u51c6\u786e\u5730\u5224\u65adLinux\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5982\u679c\u4f60\u6709\u5176\u4ed6\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u4e2d\u5206\u4eab\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u662f\u4e00\u9879\u57fa\u672c\u64cd\u4f5c\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u5feb\u901f\u51c6\u786e\u5730\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u5462\uff1f\u5728\u4f7f\u7528test\u547d\u4ee4\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a\u5982\u679c\u4f60\u53ea\u9700\u8981\u5224\u65ad\u4e00\u4e2a\u666e\u901a\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u201c-f\u201d\u53c2\u6570\u3002\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\u4e4b\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u201cls\u201d\u547d\u4ee4\u6765\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u901a\u8fc7\u4ee5\u4e0a\u516d\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u51c6\u786e\u5730\u5224\u65adLinux\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002<\/p>\n","protected":false},"author":1,"featured_media":269842,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-269841","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/269841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=269841"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/269841\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/269842"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=269841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=269841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=269841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}