{"id":72,"date":"2021-07-06T19:26:57","date_gmt":"2021-07-06T11:26:57","guid":{"rendered":"https:\/\/szx622.top\/?p=72"},"modified":"2021-07-06T19:26:57","modified_gmt":"2021-07-06T11:26:57","slug":"shell%e6%9d%a1%e4%bb%b6%e5%88%a4%e6%96%ad%e5%90%84%e9%80%89%e9%a1%b9%e7%9a%84%e7%94%a8%e6%b3%95","status":"publish","type":"post","link":"https:\/\/szx622.top\/?p=72","title":{"rendered":"shell\u6761\u4ef6\u5224\u65ad\u5404\u9009\u9879\u7684\u7528\u6cd5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">shell\u6761\u4ef6\u5224\u65adif\u4e2d\u7684-a\u5230-z\u7684\u610f\u601d<\/h2>\n\n\n\n<p>[ -a FILE ] \u5982\u679c FILE \u5b58\u5728\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -b FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u5757\u7279\u6b8a\u6587\u4ef6\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -c FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u5b57\u7279\u6b8a\u6587\u4ef6\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -d FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u76ee\u5f55\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -e FILE ] \u5982\u679c FILE \u5b58\u5728\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -f FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u666e\u901a\u6587\u4ef6\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -g FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u5df2\u7ecf\u8bbe\u7f6e\u4e86SGID\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -h FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u7b26\u53f7\u8fde\u63a5\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -k FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u7c98\u5236\u4f4d\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -p FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u540d\u5b57\u7ba1\u9053(F\u5982\u679cO)\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -r FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u53ef\u8bfb\u7684\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -s FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u5927\u5c0f\u4e0d\u4e3a0\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -t FD ] \u5982\u679c\u6587\u4ef6\u63cf\u8ff0\u7b26 FD \u6253\u5f00\u4e14\u6307\u5411\u4e00\u4e2a\u7ec8\u7aef\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -u FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u8bbe\u7f6e\u4e86SUID (set user ID)\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -w FILE ] \u5982\u679c FILE \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u53ef\u5199\u7684\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -x FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u53ef\u6267\u884c\u7684\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -O FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u5c5e\u6709\u6548\u7528\u6237ID\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -G FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u5c5e\u6709\u6548\u7528\u6237\u7ec4\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -L FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u7b26\u53f7\u8fde\u63a5\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -N FILE ] \u5982\u679c FILE \u5b58\u5728 and has been mod\u5982\u679cied since it was last read\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -S FILE ] \u5982\u679c FILE \u5b58\u5728\u4e14\u662f\u4e00\u4e2a\u5957\u63a5\u5b57\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ FILE1 -nt FILE2 ] \u5982\u679c FILE1 has been changed more recently than FILE2, or \u5982\u679c FILE1 exists and FILE2 does not\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ FILE1 -ot FILE2 ] \u5982\u679c FILE1 \u6bd4 FILE2 \u8981\u8001, \u6216\u8005 FILE2 \u5b58\u5728\u4e14 FILE1 \u4e0d\u5b58\u5728\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ FILE1 -ef FILE2 ] \u5982\u679c FILE1 \u548c FILE2 \u6307\u5411\u76f8\u540c\u7684\u8bbe\u5907\u548c\u8282\u70b9\u53f7\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -o OPTIONNAME ] \u5982\u679c shell\u9009\u9879 \u201cOPTIONNAME\u201d \u5f00\u542f\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -z STRING ] \u201cSTRING\u201d \u7684\u957f\u5ea6\u4e3a\u96f6\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ -n STRING ] or [ STRING ] \u201cSTRING\u201d \u7684\u957f\u5ea6\u4e3a\u975e\u96f6 non-zero\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ STRING1 == STRING2 ] \u5982\u679c2\u4e2a\u5b57\u7b26\u4e32\u76f8\u540c\u3002 \u201c=\u201d may be used instead of \u201c==\u201d for strict POSIX compliance\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ STRING1 != STRING2 ] \u5982\u679c\u5b57\u7b26\u4e32\u4e0d\u76f8\u7b49\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ STRING1 &lt; STRING2 ] \u5982\u679c \u201cSTRING1\u201d sorts before \u201cSTRING2\u201d lexicographically in the current locale\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ STRING1 &gt; STRING2 ] \u5982\u679c \u201cSTRING1\u201d sorts after \u201cSTRING2\u201d lexicographically in the current locale\u5219\u4e3a\u771f\u3002<\/p>\n\n\n\n<p>[ ARG1 OP ARG2 ] \u201cOP\u201d is one of -eq, -ne, -lt, -le, -gt or -ge. These arithmetic binary operators return true if \u201cARG1\u201d is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to \u201cARG2\u201d, respectively. \u201cARG1\u201d and \u201cARG2\u201d are integers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-background has-link-text-background-color has-link-text-color is-style-wide\"\/>\n\n\n\n<p>\u57fa\u672c\u4e0a\u548c\u5176\u4ed6\u811a\u672c\u8bed\u8a00\u4e00\u6837\u3002\u6ca1\u6709\u592a\u5927\u533a\u522b\u3002\u4e0d\u8fc7\u503c\u5f97\u6ce8\u610f\u7684\u662f\u3002[]\u91cc\u9762\u7684\u6761\u4ef6\u5224\u65ad\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1\u3001\u5b57\u7b26\u4e32\u5224\u65ad<\/strong><\/h2>\n\n\n\n<p>str1 = str2\u3000\u3000\u3000\u3000\u3000\u3000\u5f53\u4e24\u4e2a\u4e32\u6709\u76f8\u540c\u5185\u5bb9\u3001\u957f\u5ea6\u65f6\u4e3a\u771f<\/p>\n\n\n\n<p>str1 != str2\u3000\u3000\u3000\u3000\u3000 \u5f53\u4e32str1\u548cstr2\u4e0d\u7b49\u65f6\u4e3a\u771f<\/p>\n\n\n\n<p>-n str1\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u5f53\u4e32\u7684\u957f\u5ea6\u5927\u4e8e0\u65f6\u4e3a\u771f(\u4e32\u975e\u7a7a)<\/p>\n\n\n\n<p>-z str1\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u5f53\u4e32\u7684\u957f\u5ea6\u4e3a0\u65f6\u4e3a\u771f(\u7a7a\u4e32)<\/p>\n\n\n\n<p>str1\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u5f53\u4e32str1\u4e3a\u975e\u7a7a\u65f6\u4e3a\u771f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2\u3001\u6570\u5b57\u7684\u5224\u65ad<\/strong><\/h2>\n\n\n\n<p>int1 -eq int2\u3000\u3000\u3000\u3000\u4e24\u6570\u76f8\u7b49\u4e3a\u771f<\/p>\n\n\n\n<p>int1 -ne int2\u3000\u3000\u3000\u3000\u4e24\u6570\u4e0d\u7b49\u4e3a\u771f<\/p>\n\n\n\n<p>int1 -gt int2\u3000\u3000\u3000\u3000int1\u5927\u4e8eint2\u4e3a\u771f<\/p>\n\n\n\n<p>int1 -ge int2\u3000\u3000\u3000\u3000int1\u5927\u4e8e\u7b49\u4e8eint2\u4e3a\u771f<\/p>\n\n\n\n<p>int1 -lt int2\u3000\u3000\u3000\u3000int1\u5c0f\u4e8eint2\u4e3a\u771f<\/p>\n\n\n\n<p>int1 -le int2\u3000\u3000\u3000\u3000int1\u5c0f\u4e8e\u7b49\u4e8eint2\u4e3a\u771f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3\u3001\u6587\u4ef6\u7684\u5224\u65ad<\/strong><\/h2>\n\n\n\n<p>-r file\u3000\u3000\u3000\u3000\u3000\u7528\u6237\u53ef\u8bfb\u4e3a\u771f<\/p>\n\n\n\n<p>-w file\u3000\u3000\u3000\u3000\u3000\u7528\u6237\u53ef\u5199\u4e3a\u771f<\/p>\n\n\n\n<p>-x file\u3000\u3000\u3000\u3000\u3000\u7528\u6237\u53ef\u6267\u884c\u4e3a\u771f<\/p>\n\n\n\n<p>-f file\u3000\u3000\u3000\u3000\u3000\u6587\u4ef6\u4e3a\u6b63\u89c4\u6587\u4ef6\u4e3a\u771f<\/p>\n\n\n\n<p>-d file\u3000\u3000\u3000\u3000\u3000\u6587\u4ef6\u4e3a\u76ee\u5f55\u4e3a\u771f<\/p>\n\n\n\n<p>-c file\u3000\u3000\u3000\u3000\u3000\u6587\u4ef6\u4e3a\u5b57\u7b26\u7279\u6b8a\u6587\u4ef6\u4e3a\u771f<\/p>\n\n\n\n<p>-b file\u3000\u3000\u3000\u3000\u3000\u6587\u4ef6\u4e3a\u5757\u7279\u6b8a\u6587\u4ef6\u4e3a\u771f<\/p>\n\n\n\n<p>-s file\u3000\u3000\u3000\u3000\u3000\u6587\u4ef6\u5927\u5c0f\u975e0\u65f6\u4e3a\u771f<\/p>\n\n\n\n<p>-t file\u3000\u3000\u3000\u3000\u3000\u5f53\u6587\u4ef6\u63cf\u8ff0\u7b26(\u9ed8\u8ba4\u4e3a1)\u6307\u5b9a\u7684\u8bbe\u5907\u4e3a\u7ec8\u7aef\u65f6\u4e3a\u771f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4\u3001\u590d\u6742\u903b\u8f91\u5224\u65ad<\/strong><\/h2>\n\n\n\n<p>-a \u3000 \u3000\u3000\u3000\u3000\u3000 \u4e0e<\/p>\n\n\n\n<p>-o\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u6216<\/p>\n\n\n\n<p>!\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u975e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>shell\u6761\u4ef6\u5224\u65adif\u4e2d\u7684-a\u5230-z\u7684\u610f\u601d [ -a FILE ] \u5982\u679c FILE \u5b58\u5728\u5219\u4e3a\u771f\u3002 [ -b F [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,12],"tags":[19,18,20],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-shell","category-linux","tag-if","tag-shell","tag-20"],"_links":{"self":[{"href":"https:\/\/szx622.top\/index.php?rest_route=\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szx622.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/szx622.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/szx622.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/szx622.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":1,"href":"https:\/\/szx622.top\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":73,"href":"https:\/\/szx622.top\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/73"}],"wp:attachment":[{"href":"https:\/\/szx622.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/szx622.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/szx622.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}