{"id":62,"date":"2021-04-20T13:40:21","date_gmt":"2021-04-20T05:40:21","guid":{"rendered":"http:\/\/47.117.112.237\/?p=62"},"modified":"2021-05-12T21:02:46","modified_gmt":"2021-05-12T13:02:46","slug":"linuxcommands","status":"publish","type":"post","link":"https:\/\/www.zhishirepository.com\/index.php\/2021\/04\/20\/linuxcommands\/","title":{"rendered":"linux\u5e38\u7528\u6307\u4ee4\u968f\u624b\u8bb0"},"content":{"rendered":"\n<p style=\"font-size:18px\">free -h \u67e5\u770b\u7cfb\u7edf\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<br>tar -cvf xxx.tar file1 file2 &#8230; \u6253\u5305\u6587\u4ef6<\/p>\n\n\n\n<p style=\"font-size:18px\">rpm -qa | grep php \u53ef\u4ee5\u67e5\u770b\u76ee\u524d\u5b89\u88c5\u7684\u4e0ephp\u6709\u5173\u7684\u7a0b\u5e8f\u6709\u54ea\u4e9b<br>yum search php74 \u53ef\u4ee5\u67e5\u770b\u6709\u54ea\u4e9b\u4e0ephp74\u76f8\u5173\u7684\u8f6f\u4ef6\u53ef\u4ee5\u5b89\u88c5\uff0c\u5728\u5b89\u88c5\u7a0b\u5e8f\u65f6\u53ef\u4ee5\u4f7f\u7528<\/p>\n\n\n\n<p style=\"font-size:18px\">uname -a \u67e5\u770bLinux\u5185\u6838\u7248\u672c<\/p>\n\n\n\n<p style=\"font-size:18px\"><strong>!$<\/strong> \u4ee3\u8868\u4e0a\u4e00\u6761\u6307\u4ee4\u7684\u53c2\u6570<br><strong>!! <\/strong>\u518d\u6b21\u6267\u884c\u4e0a\u4e00\u6761\u547d\u4ee4<\/p>\n\n\n\n<p style=\"font-size:18px\">tar -cvf test.tar test \u4ec5\u5bf9test\u6253\u5305\uff0c\u4e0d\u538b\u7f29<br>tar -xvf test.tar \u89e3\u538btest.tar<\/p>\n\n\n\n<p style=\"font-size:18px\">tar -zcvf<br>tar -zxvf<\/p>\n\n\n\n<p style=\"font-size:18px\">\u5e8f\u53f7 \u9009\u9879 \u8bf4\u660e<br>1 -c \u521b\u5efa\u5b58\u6863\u6587\u4ef6\uff0c\u4e0e-x\u76f8\u65a5\uff08create\uff09<br>2 -t \u5217\u51fa\u6863\u6848\u6587\u4ef6\u7684\u6587\u4ef6\u5217\u8868<br>3 -x \u89e3\u5305\u5b58\u6863\u6587\u4ef6\uff0c\u4e0e-c\u76f8\u65a5<br>4 -A \u5408\u5e76\u5b58\u6863\u6587\u4ef6<br>5 -d \u6bd4\u8f83\u5b58\u6863\u6587\u4ef6\u4e0e\u6e90\u6587\u4ef6<br>6 -r \u8ffd\u52a0\u6587\u4ef6\u5230\u5b58\u6863\u6587\u4ef6\u672b\u5c3e<br>7 -u \u66f4\u65b0\u5b58\u6863\u6587\u4ef6<br>8 -f \u6307\u5b9a\u5b58\u6863\u6587\u4ef6\uff0c\u4e0e\u5176\u5b83\u9009\u9879\u540c\u65f6\u4f7f\u7528\u65f6\uff0c\u5fc5\u987b\u5728\u6700\u540e<br>\u4f8b\u5982tar -xjvf a.tar.bz2<br>9 -v \u663e\u793a\u8be6\u7ec6\u5904\u7406\u4fe1\u606f<br>10 -C \u8f6c\u5230\u6307\u5b9a\u76ee\u5f55\uff0c\u5e38\u7528\u4e8e\u89e3\u5f00\u5b58\u6863\u6587\u4ef6\u5230\u6307\u5b9a\u76ee\u5f55<br>11 -j \u8c03\u7528bzip2\u7a0b\u5e8f<br>12 -z \u8c03\u7528gzip\u7a0b\u5e8f<br>13 -Z \u8c03\u7528 compress \u7a0b\u5e8f<\/p>\n\n\n\n<p style=\"font-size:18px\">add new user of linux<br>: useradd NAME<br>config passwd of NAME<br>: passwd NAME<\/p>\n\n\n\n<p style=\"font-size:18px\">date +%F #\u67e5\u770b\u5f53\u524d\u65e5\u671f<br>date +%T #\u67e5\u770b\u5f53\u524d\u65f6\u95f4<br>date +%A #\u67e5\u770b\u5f53\u524d\u662f\u5468\u51e0<br>cal #\u67e5\u770b\u672c\u6708\u7684\u65e5\u5386\uff0c\u5f53\u5929\u7684\u65e5\u671f\u4f1a\u6709\u6807\u8bb0<br>date +&#8221;%F %T&#8221; #\u7ec4\u5408\u67e5\u770b\u5f53\u524d\u7684\u65e5\u671f\u548c\u65f6\u95f4<\/p>\n\n\n\n<p style=\"font-size:18px\">pkill -kill -t pts\/0 #\u7528root\u6743\u9650\u53ef\u4ee5\u5f3a\u5236\u9000\u51fa\u5176\u4ed6\u767b\u5f55\u7528\u6237<\/p>\n\n\n\n<p style=\"font-size:18px\">cd &#8211; \u8fd4\u56de\u524d\u4e00\u4e2a\u5de5\u4f5c\u8def\u5f84<\/p>\n\n\n\n<p style=\"font-size:18px\">last \u547d\u4ee4\u7528\u4e8e\u663e\u793a\u7528\u6237\u6700\u8fd1\u767b\u5f55\u4fe1\u606f<\/p>\n\n\n\n<p style=\"font-size:18px\">man ascii<br>\u83b7\u5f97\u4e00\u4e2a\u597d\u7528\u7684ASCII\u8868\u683c\uff0c\u5305\u542b10\u8fdb\u5236\u548c16\u8fdb\u5236\u7684\u503c<\/p>\n\n\n\n<p style=\"font-size:18px\">crontab -e \u7f16\u8f91\u5b9a\u671f\u6267\u884c\u6307\u4ee4<br>crontab -l \u67e5\u770b\u76ee\u524d\u7684\u5b9a\u671f\u6267\u884c\u7684\u4efb\u52a1\u6307\u4ee4<br>crontab \u683c\u5f0f\u5982\u4e0b<br>crontab \u4e2d\u6709\u516d\u4e2a\u5b57\u6bb5\uff0c\u5176\u542b\u4e49\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p style=\"font-size:18px\">\u7b2c1\u4e2a\u5b57\u6bb5\uff1a\u5206\u949f (0-59)<br>\u7b2c2\u4e2a\u5b57\u6bb5\uff1a\u5c0f\u65f6 (0-23)<br>\u7b2c3\u4e2a\u5b57\u6bb5\uff1a\u65e5\u671f (1-31)<br>\u7b2c4\u4e2a\u5b57\u6bb5\uff1a\u6708\u4efd (1-12 [12 \u4ee3\u8868 December])<br>\u7b2c5\u4e2a\u5b57\u6bb5\uff1a\u4e00\u5468\u5f53\u4e2d\u7684\u67d0\u5929 (0-7 [7 \u6216 0 \u4ee3\u8868\u661f\u671f\u5929])<br>\/path\/to\/command \u2013 \u8ba1\u5212\u6267\u884c\u7684\u811a\u672c\u6216\u547d\u4ee4\u7684\u540d\u79f0<\/p>\n\n\n\n<p style=\"font-size:18px\">\u4ee5.py\u4e3a\u6269\u5c55\u540d\u521b\u5efa\u4e00\u4e2apython\u6587\u4ef6\uff0c\u5728\u7ec8\u7aef\u6267\u884c\u7684\u65b9\u6cd5\u662f python3 example.py<\/p>\n\n\n\n<p style=\"font-size:18px\">vim\u5728\u7f16\u8f91\u6587\u4ef6\u65f6\uff0c\u6309\u4e86Ctrl+S\u540e\u600e\u4e48\u90fd\u4e0d\u52a8\u4e86\u3002<\/p>\n\n\n\n<p style=\"font-size:18px\">Ctrl+S \uff1a\u5728Linux \u4e0b\u662f\u9501\u5b9a\u5c4f\u5e55\u7684\u5feb\u6377\u952e\uff0c\u4f7f\u7528Ctrl+Q \u89e3\u9501\u3002<\/p>\n\n\n\n<p style=\"font-size:18px\">cut\u7684\u7528\u6cd5<\/p>\n\n\n\n<p style=\"font-size:18px\">cat t | cut -c 11-25,26,78-85<\/p>\n\n\n\n<p style=\"font-size:18px\">cut -b byte \u4ee5byte\u4e3a\u754c\u6765\u5207\u5206<\/p>\n\n\n\n<p style=\"font-size:18px\">cut -c \u4ee5\u5b57\u7b26\u6765\u5207\u5206<\/p>\n\n\n\n<p style=\"font-size:18px\">cut -d : -f 1,3-5 \u4ee5\uff1a\u4e3a\u754c\u5207\u5272\uff0c\u8f93\u51fa 1 3 4 5 \u57df\u7684\u5185\u5bb9<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>free -h \u67e5\u770b\u7cfb\u7edf\u5185\u5b58\u4f7f\u7528\u60c5\u51b5tar -cvf xxx.tar file1 file2 &#8230;  &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.zhishirepository.com\/index.php\/2021\/04\/20\/linuxcommands\/\"> <span class=\"screen-reader-text\">linux\u5e38\u7528\u6307\u4ee4\u968f\u624b\u8bb0<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[3],"tags":[10,8],"_links":{"self":[{"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/posts\/62"}],"collection":[{"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":28,"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/posts\/62\/revisions\/463"}],"wp:attachment":[{"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhishirepository.com\/index.php\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}