{"id":154,"date":"2016-03-28T14:44:34","date_gmt":"2016-03-28T06:44:34","guid":{"rendered":"http:\/\/blog.droidking.com\/?p=154"},"modified":"2016-03-29T13:13:14","modified_gmt":"2016-03-29T05:13:14","slug":"linux%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e6%95%b4%e7%90%86%ef%bc%88%e4%b8%8d%e5%ae%9a%e6%9c%9f%e6%9b%b4%e6%96%b0%ef%bc%89","status":"publish","type":"post","link":"http:\/\/droidking.com\/?p=154","title":{"rendered":"Linux\u5e38\u7528\u547d\u4ee4\u6574\u7406\uff08\u4e0d\u5b9a\u671f\u66f4\u65b0\uff09"},"content":{"rendered":"<p><strong>#\u67e5\u770b\u7cfb\u7edf\u7248\u672c<\/strong><br \/>\nuname -a<br \/>\ncat \/etc\/issue<\/p>\n<p><strong>#\u4fee\u6539\u7cfb\u7edf\u65f6\u533a<\/strong><br \/>\n#\u5148\u4f7f\u7528<span class=\"s1\">tzselect\u6309\u63d0\u793a\u4e00\u6b65\u6b65\u627e\u5230\u5bf9\u5e94\u7684\u65f6\u533a\uff0c\u6bd4\u5982Asia\/Shanghai\uff0c\u7136\u540e\uff1a<br \/>\n<\/span>echo \"Asia\/Shanghai\" | sudo tee \/etc\/timezone<br \/>\nsudo dpkg-reconfigure --frontend noninteractive tzdata<\/p>\n<p><strong>#\u67e5\u770b\u8fdb\u7a0b\u4fa6\u542c\u7684\u7aef\u53e3<br \/>\n<\/strong>lsof -iTCP -sTCP:LISTEN -n -P<\/p>\n<p><strong>#\u67e5\u770b\u76ee\u5f55\u5927\u5c0f\uff08h\uff1a\u81ea\u52a8\u4f7f\u7528\u6700\u4f73\u53ef\u8bfb\u5355\u4f4d\uff0cc\uff1a\u6700\u540e\u663e\u793a\u603b\u5927\u5c0f\uff09<\/strong><br \/>\ndu -hc \/path<br \/>\ndu -k \/path | sort -nr<\/p>\n<p><strong>#\u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<\/strong><br \/>\n<span class=\"s1\">df -h<\/span><\/p>\n<p><strong>#\u521b\u5efa\u7a7a\u6587\u4ef6<\/strong><br \/>\ntouch filename<\/p>\n<p><!--more--><\/p>\n<p><strong>#\u67e5\u627e\u6587\u4ef6<\/strong><br \/>\n<span class=\"s1\">find \/etc\/ -name \"*.conf\"<\/span><\/p>\n<p><strong>#\u67e5\u627e\u6587\u4ef6\u5185\u5bb9<\/strong><br \/>\n<span class=\"s1\">grep -r \"apache2\" \/etc<br \/>\n<strong>#--color\uff1a\u9ad8\u4eae\u663e\u793a\u5339\u914d\uff0c-i\uff1a\u5ffd\u7565\u5927\u5c0f\u5199\uff0c-H\uff1a\u663e\u793a\u6587\u4ef6\u540d<\/strong><br \/>\n<\/span><span class=\"s1\">grep --color -r -i -H \"aPachE2\" \/etc<br \/>\n<\/span><\/p>\n<p><strong>#\u7ec4\u5408\u547d\u4ee4\uff1a<\/strong><br \/>\n<span class=\"s1\">find \/etc\/ -name *.conf 2&gt;\/dev\/null -exec grep --color -H \"apache2\" {} \\;<\/span><\/p>\n<p><strong>#\u67e5\u770bapache2\u6240\u6709\u5b50\u8fdb\u7a0b\u7684\u5185\u5b58\u603b\u5360\u7528:<br \/>\n<\/strong><span class=\"s1\">ps -ylC apache2 | awk '{x += $8;y += 1} END {print \"Total (MB): \"x\/1024; print \"Average (MB): \"x\/((y-1)*1024)}'<\/span><\/p>\n<p class=\"bawpvc-ajax-counter\" data-id=\"154\">\u9605\u8bfb\uff1a263<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#\u67e5\u770b\u7cfb\u7edf\u7248\u672c uname -a cat \/etc\/issue #\u4fee\u6539\u7cfb\u7edf\u65f6\u533a #\u5148\u4f7f\u7528tzselect\u6309\u63d0\u793a &hellip; <a href=\"http:\/\/droidking.com\/?p=154\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Linux\u5e38\u7528\u547d\u4ee4\u6574\u7406\uff08\u4e0d\u5b9a\u671f\u66f4\u65b0\uff09<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,17,38,5],"tags":[],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-linux","category-os-x","category-vi","category-5"],"_links":{"self":[{"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":12,"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":289,"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/289"}],"wp:attachment":[{"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}