{"id":64,"date":"2024-02-03T01:04:20","date_gmt":"2024-02-02T17:04:20","guid":{"rendered":"https:\/\/ishht.com\/?p=64"},"modified":"2024-02-03T01:04:20","modified_gmt":"2024-02-02T17:04:20","slug":"linux%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%85%a8","status":"publish","type":"post","link":"https:\/\/ishht.com\/?p=64","title":{"rendered":"Linux\u5e38\u7528\u547d\u4ee4\u5927\u5168"},"content":{"rendered":"<p>\u6700\u8fd1\u90fd\u5728\u548cLinux\u6253\u4ea4\u9053\uff0c\u611f\u89c9\u8fd8\u4e0d\u9519\u3002\u6211\u89c9\u5f97Linux\u76f8\u6bd4windows\u6bd4\u8f83\u9ebb\u70e6\u7684\u5c31\u662f\u5f88\u591a\u4e1c\u897f\u90fd\u8981\u7528\u547d\u4ee4\u6765\u63a7\u5236\uff0c\u5f53\u7136\uff0c\u8fd9\u4e5f\u662f\u5f88\u591a\u4eba\u559c\u6b22linux\u7684\u539f\u56e0\uff0c\u6bd4\u8f83\u77ed\u5c0f\u4f46\u5374\u529f\u80fd\u5f3a\u5927\u3002\u6211\u5c06\u6211\u4e86\u89e3\u5230\u7684\u547d\u4ee4\u5217\u4e3e\u4e00\u4e0b\uff0c\u4ec5\u4f9b\u5927\u5bb6\u53c2\u8003\uff1a<\/p>\n<p>\u7cfb\u7edf\u4fe1\u606f<br \/>\narch \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784(1)<br \/>\nuname -m \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784(2)<br \/>\nuname -r \u663e\u793a\u6b63\u5728\u4f7f\u7528\u7684\u5185\u6838\u7248\u672c<br \/>\ndmidecode -q \u663e\u793a\u786c\u4ef6\u7cfb\u7edf\u90e8\u4ef6 &#8211; (SMBIOS \/ DMI)<br \/>\nhdparm -i \/dev\/hda \u7f57\u5217\u4e00\u4e2a\u78c1\u76d8\u7684\u67b6\u6784\u7279\u6027<br \/>\nhdparm -tT \/dev\/sda \u5728\u78c1\u76d8\u4e0a\u6267\u884c\u6d4b\u8bd5\u6027\u8bfb\u53d6\u64cd\u4f5c<br \/>\ncat \/proc\/cpuinfo \u663e\u793aCPU info\u7684\u4fe1\u606f<br \/>\ncat \/proc\/interrupts \u663e\u793a\u4e2d\u65ad<br \/>\ncat \/proc\/meminfo \u6821\u9a8c\u5185\u5b58\u4f7f\u7528<br \/>\ncat \/proc\/swaps \u663e\u793a\u54ea\u4e9bswap\u88ab\u4f7f\u7528<br \/>\ncat \/proc\/version \u663e\u793a\u5185\u6838\u7684\u7248\u672c<br \/>\ncat \/proc\/net\/dev \u663e\u793a\u7f51\u7edc\u9002\u914d\u5668\u53ca\u7edf\u8ba1<br \/>\ncat \/proc\/mounts \u663e\u793a\u5df2\u52a0\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf<br \/>\nlspci -tv \u7f57\u5217 PCI \u8bbe\u5907<br \/>\nlsusb -tv \u663e\u793a USB \u8bbe\u5907<br \/>\ndate \u663e\u793a\u7cfb\u7edf\u65e5\u671f<br \/>\ncal 2007 \u663e\u793a2007\u5e74\u7684\u65e5\u5386\u8868<br \/>\ndate 041217002007.00 \u8bbe\u7f6e\u65e5\u671f\u548c\u65f6\u95f4 &#8211; \u6708\u65e5\u65f6\u5206\u5e74.\u79d2<br \/>\nclock -w \u5c06\u65f6\u95f4\u4fee\u6539\u4fdd\u5b58\u5230 BIOS<\/p>\n<p>\u5173\u673a (\u7cfb\u7edf\u7684\u5173\u673a\u3001\u91cd\u542f\u4ee5\u53ca\u767b\u51fa )<br \/>\nshutdown -h now \u5173\u95ed\u7cfb\u7edf(1)<br \/>\ninit 0 \u5173\u95ed\u7cfb\u7edf(2)<br \/>\ntelinit 0 \u5173\u95ed\u7cfb\u7edf(3)<br \/>\nshutdown -h hours:minutes &amp; \u6309\u9884\u5b9a\u65f6\u95f4\u5173\u95ed\u7cfb\u7edf<br \/>\nshutdown -c \u53d6\u6d88\u6309\u9884\u5b9a\u65f6\u95f4\u5173\u95ed\u7cfb\u7edf<br \/>\nshutdown -r now \u91cd\u542f(1)<br \/>\nreboot \u91cd\u542f(2)<br \/>\nlogout \u6ce8\u9500<\/p>\n<p>\u6587\u4ef6\u548c\u76ee\u5f55<br \/>\ncd \/home \u8fdb\u5165 \u2018\/ home\u2019 \u76ee\u5f55\u2019<br \/>\ncd \u2026 \u8fd4\u56de\u4e0a\u4e00\u7ea7\u76ee\u5f55<br \/>\ncd \u2026\/\u2026 \u8fd4\u56de\u4e0a\u4e24\u7ea7\u76ee\u5f55<br \/>\ncd \u8fdb\u5165\u4e2a\u4eba\u7684\u4e3b\u76ee\u5f55<br \/>\ncd ~user1 \u8fdb\u5165\u4e2a\u4eba\u7684\u4e3b\u76ee\u5f55<br \/>\ncd &#8211; \u8fd4\u56de\u4e0a\u6b21\u6240\u5728\u7684\u76ee\u5f55<br \/>\npwd \u663e\u793a\u5de5\u4f5c\u8def\u5f84<br \/>\nls \u67e5\u770b\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6<br \/>\nls -F \u67e5\u770b\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6<br \/>\nls -l \u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u8be6\u7ec6\u8d44\u6599<br \/>\nls -a \u663e\u793a\u9690\u85cf\u6587\u4ef6<br \/>\nls [0-9] \u663e\u793a\u5305\u542b\u6570\u5b57\u7684\u6587\u4ef6\u540d\u548c\u76ee\u5f55\u540d<br \/>\ntree \u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7531\u6839\u76ee\u5f55\u5f00\u59cb\u7684\u6811\u5f62\u7ed3\u6784(1)<br \/>\nlstree \u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7531\u6839\u76ee\u5f55\u5f00\u59cb\u7684\u6811\u5f62\u7ed3\u6784(2)<br \/>\nmkdir dir1 \u521b\u5efa\u4e00\u4e2a\u53eb\u505a \u2018dir1\u2019 \u7684\u76ee\u5f55\u2019<br \/>\nmkdir dir1 dir2 \u540c\u65f6\u521b\u5efa\u4e24\u4e2a\u76ee\u5f55<br \/>\nmkdir -p \/tmp\/dir1\/dir2 \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u6811<br \/>\nrm -f file1 \u5220\u9664\u4e00\u4e2a\u53eb\u505a \u2018file1\u2019 \u7684\u6587\u4ef6\u2019<br \/>\nrmdir dir1 \u5220\u9664\u4e00\u4e2a\u53eb\u505a \u2018dir1\u2019 \u7684\u76ee\u5f55\u2019<br \/>\nrm -rf dir1 \u5220\u9664\u4e00\u4e2a\u53eb\u505a \u2018dir1\u2019 \u7684\u76ee\u5f55\u5e76\u540c\u65f6\u5220\u9664\u5176\u5185\u5bb9<br \/>\nrm -rf dir1 dir2 \u540c\u65f6\u5220\u9664\u4e24\u4e2a\u76ee\u5f55\u53ca\u5b83\u4eec\u7684\u5185\u5bb9<br \/>\nmv dir1 new_dir \u91cd\u547d\u540d\/\u79fb\u52a8 \u4e00\u4e2a\u76ee\u5f55<br \/>\ncp file1 file2 \u590d\u5236\u4e00\u4e2a\u6587\u4ef6<br \/>\ncp dir\/* . \u590d\u5236\u4e00\u4e2a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<br \/>\ncp -a \/tmp\/dir1 . \u590d\u5236\u4e00\u4e2a\u76ee\u5f55\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<br \/>\ncp -a dir1 dir2 \u590d\u5236\u4e00\u4e2a\u76ee\u5f55<br \/>\nln -s file1 lnk1 \u521b\u5efa\u4e00\u4e2a\u6307\u5411\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u8f6f\u94fe\u63a5<br \/>\nln file1 lnk1 \u521b\u5efa\u4e00\u4e2a\u6307\u5411\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u7269\u7406\u94fe\u63a5<br \/>\ntouch -t 0712250000 file1 \u4fee\u6539\u4e00\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u65f6\u95f4\u6233 &#8211; (YYMMDDhhmm)<br \/>\nfile file1 outputs the mime type of the file as text<br \/>\niconv -l \u5217\u51fa\u5df2\u77e5\u7684\u7f16\u7801<br \/>\niconv -f fromEncoding -t toEncoding inputFile &gt; outputFile creates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding.<br \/>\nfind . -maxdepth 1 -name *.jpg -print -exec convert \u201c{}\u201d -resize 80&#215;60 \u201cthumbs\/{}\u201d ; batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick)<\/p>\n<p>\u6587\u4ef6\u641c\u7d22<br \/>\nfind \/ -name file1 \u4ece \u2018\/\u2019 \u5f00\u59cb\u8fdb\u5165\u6839\u6587\u4ef6\u7cfb\u7edf\u641c\u7d22\u6587\u4ef6\u548c\u76ee\u5f55<br \/>\nfind \/ -user user1 \u641c\u7d22\u5c5e\u4e8e\u7528\u6237 \u2018user1\u2019 \u7684\u6587\u4ef6\u548c\u76ee\u5f55<br \/>\nfind \/home\/user1 -name *.bin \u5728\u76ee\u5f55 \u2018\/ home\/user1\u2019 \u4e2d\u641c\u7d22\u5e26\u6709\u2019.bin\u2019 \u7ed3\u5c3e\u7684\u6587\u4ef6<br \/>\nfind \/usr\/bin -type f -atime +100 \u641c\u7d22\u5728\u8fc7\u53bb100\u5929\u5185\u672a\u88ab\u4f7f\u7528\u8fc7\u7684\u6267\u884c\u6587\u4ef6<br \/>\nfind \/usr\/bin -type f -mtime -10 \u641c\u7d22\u572810\u5929\u5185\u88ab\u521b\u5efa\u6216\u8005\u4fee\u6539\u8fc7\u7684\u6587\u4ef6<br \/>\nfind \/ -name *.rpm -exec chmod 755 \u2018{}\u2019 ; \u641c\u7d22\u4ee5 \u2018.rpm\u2019 \u7ed3\u5c3e\u7684\u6587\u4ef6\u5e76\u5b9a\u4e49\u5176\u6743\u9650<br \/>\nfind \/ -xdev -name *.rpm \u641c\u7d22\u4ee5 \u2018.rpm\u2019 \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5ffd\u7565\u5149\u9a71\u3001\u6377\u76d8\u7b49\u53ef\u79fb\u52a8\u8bbe\u5907<br \/>\nlocate *.ps \u5bfb\u627e\u4ee5 \u2018.ps\u2019 \u7ed3\u5c3e\u7684\u6587\u4ef6 &#8211; \u5148\u8fd0\u884c \u2018updatedb\u2019 \u547d\u4ee4<br \/>\nwhereis halt \u663e\u793a\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u3001\u6e90\u7801\u6216man\u7684\u4f4d\u7f6e<br \/>\nwhich halt \u663e\u793a\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u6216\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84<\/p>\n<p>\u8fd9\u91cc\u5bf9FIND\u641c\u7d22\u547d\u4ee4\u8fdb\u884c\u4e00\u4e2a\u8be6\u7ec6\u7684\u89e3\u6790<br \/>\nfind\u547d\u4ee4\u7528\u6765\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u67e5\u627e\u6587\u4ef6\u3002\u4efb\u4f55\u4f4d\u4e8e\u53c2\u6570\u4e4b\u524d\u7684\u5b57\u7b26\u4e32\u90fd\u5c06\u88ab\u89c6\u4e3a\u6b32\u67e5\u627e\u7684\u76ee\u5f55\u540d\u3002<\/p>\n<p>\u4e0b\u9762\u4ecb\u7ecd\u4e00\u4e9b\u5173\u4e8e\u4f7f\u7528find\u547d\u4ee4\u67e5\u627e\u6587\u4ef6\u7684\u547d\u4ee4\u683c\u5f0f\u548c\u793a\u4f8b\uff1a<\/p>\n<p>1.\u683c\u5f0f\uff1a<\/p>\n<p>find +\u76ee\u5f55 +\u6761\u4ef6 +\u6761\u4ef6\u503c<\/p>\n<p>\u5982\u679c\u4f7f\u7528\u8be5\u547d\u4ee4\u65f6\uff0c\u4e0d\u8bbe\u7f6e\u4efb\u4f55\u53c2\u6570\uff0c\u5219find\u547d\u4ee4\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u67e5\u627e\u5b50\u76ee\u5f55\u4e0e\u6587\u4ef6\uff0c<\/p>\n<p>\u5e76\u4e14\u5c06\u67e5\u627e\u5230\u7684\u5b50\u76ee\u5f55\u548c\u6587\u4ef6\u5168\u90e8\u8fdb\u884c\u663e\u793a\uff0c\u5982\u56fe\uff0c\u5728\/root\u4e0b\u7684\u5b50\u76ee\u5f55\u548c\u6587\u4ef6\u5168\u90e8\u663e\u793a\u51fa\u6765\uff08\u622a\u53d6\u90e8\u5206\uff09\uff1a<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ishht.com\/wp-content\/uploads\/2024\/02\/20240202170154834121-300x137.webp\" alt=\"\" width=\"300\" height=\"137\" class=\"alignnone size-medium wp-image-65\" srcset=\"https:\/\/ishht.com\/wp-content\/uploads\/2024\/02\/20240202170154834121-300x137.webp 300w, https:\/\/ishht.com\/wp-content\/uploads\/2024\/02\/20240202170154834121.webp 735w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>2.find\u547d\u4ee4\u67e5\u627e\u6587\u4ef6\u76f8\u5173\u7ec6\u5206\u6761\u4ef6\uff0c\u6761\u4ef6\u8d8a\u591a\uff0c\u67e5\u627e\u8d8a\u51c6\u786e<\/p>\n<p>2.1.\u6839\u636e\u6587\u4ef6\u683c\u5f0f\u8fdb\u884c\u67e5\u627e\uff1a<\/p>\n<p>.<span>\u5728\/home\u4e0b\u67e5\u627e\u6240\u6709\u4ee5 .txt \u7ed3\u5c3e\u7684\u6587\u4ef6\uff1a find \/home -name \u201c*.txt&#8221; \uff1a<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ishht.com\/wp-content\/uploads\/2024\/02\/20240202170239797068-300x53.webp\" alt=\"\" width=\"300\" height=\"53\" class=\"alignnone size-medium wp-image-66\" srcset=\"https:\/\/ishht.com\/wp-content\/uploads\/2024\/02\/20240202170239797068-300x53.webp 300w, https:\/\/ishht.com\/wp-content\/uploads\/2024\/02\/20240202170239797068.webp 735w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u5728\u5f53\u524d\u76ee\u5f55\u53ca\u5b50\u76ee\u5f55\u4e0b\u67e5\u627e\u6240\u6709\u4ee5 .txt \u548c .pdf \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c-o \u7684\u610f\u601d\u4e3a\u6216\u8005\uff0c\u672c\u673a\u6ca1\u6709.pdf \u683c\u5f0f\u7684\u6587\u4ef6\uff1a<\/p>\n<p>\u5f53\u524d\u76ee\u5f55\u53ca\u5b50\u76ee\u5f55\u4e0b\u67e5\u627e\u6240\u6709\u4ee5.txt\u548c.pdf\u7ed3\u5c3e\u7684\u6587\u4ef6<\/p>\n<p>\u6765\u81ea: http:\/\/man.linuxde.net\/find<br \/>\n\u5f53\u524d\u76ee\u5f55\u53ca\u5b50\u76ee\u5f55\u4e0b\u67e5\u627e\u6240\u6709\u4ee5.txt\u548c.pdf\u7ed3\u5c3e\u7684\u6587\u4ef6<br \/>\n<span>\u6765\u81ea: http:\/\/man.linuxde.net\/find<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u91cc\u5bf9Linux\u7684grep\u6587\u672c\u641c\u7d22\u547d\u4ee4\u8fdb\u884c\u4e00\u4e2a\u8be6\u7ec6\u7684\u89e3\u6790\uff1a<br \/>\n\u641c\u7d22isPlay\uff0c\u5f15\u53f7\u52a0\u4e0d\u52a0\u5355\u5f15\u53f7\u53cc\u5f15\u53f7\u90fd\u53ef\u4ee5\uff1agrep -rn \u201cisPlay\u201d<\/p>\n<p>\u641c\u7d22isPlay\uff0c\u5ffd\u7565\u5927\u5c0f\u5199\uff1agrep -rn -i \u201cisPlay\u201d<\/p>\n<p>\u641c\u7d22isPlay\uff0c\u589e\u52a0\u901a\u914d\u7b26\uff08\u70b9\u53f7\u548c*\u53f7\u914d\u5408\u4f7f\u7528\uff09\uff1agrep -rn is.*lay<\/p>\n<p>\u641c\u7d22isPlay\uff0c\u5728\u6307\u5b9a\u7684\u76ee\u5f55\u4e0b\u641c\u7d22\uff1a grep -rn isPlay frameworks\/base\/media\/<\/p>\n<p>\u641c\u7d22isPlay\uff0c\u5f00\u542flogcat\u5e76\u5728\u6307\u5b9a\u76ee\u5f55\u4e0b\u8fc7\u6ee4isPlay\uff1a<\/p>\n<p>adb logcat | grep -rn isPlay \/work\/android_8.1\/packages\/testapps\/MediaTest\/<\/p>\n<p>\u6e05\u9664\u7f13\u51b2\u533alog \uff1aadb logcat -c<\/p>\n<p>Grep\u9009\u9879\uff1a<\/p>\n<p>: \u8868\u793a\u5f53\u524d\u76ee\u5f55\u6240\u6709\u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u662f\u67d0\u4e2a\u6587\u4ef6\u540d<br \/>\n-r \u662f\u9012\u5f52\u67e5\u627e<br \/>\n-n \u662f\u663e\u793a\u884c\u53f7<br \/>\n-R \u67e5\u627e\u6240\u6709\u6587\u4ef6\u5305\u542b\u5b50\u76ee\u5f55<br \/>\n-i \u5ffd\u7565\u5927\u5c0f\u5199<br \/>\n\u547d\u4ee4\u884c\u53c2\u6570\uff1a<br \/>\ngrep -i pattern files \uff1a\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u5730\u641c\u7d22\u3002\u9ed8\u8ba4\u60c5\u51b5\u533a\u5206\u5927\u5c0f\u5199<br \/>\ngrep -l pattern files \uff1a\u53ea\u5217\u51fa\u5339\u914d\u7684\u6587\u4ef6\u540d,\u4e0d\u5217\u51fa\u8def\u5f84<br \/>\ngrep -L pattern files \uff1a\u5217\u51fa\u4e0d\u5339\u914d\u7684\u6587\u4ef6\u540d<br \/>\ngrep -w pattern files \uff1a\u53ea\u5339\u914d\u6574\u4e2a\u5355\u8bcd\uff0c\u800c\u4e0d\u662f\u5b57\u7b26\u4e32\u7684\u4e00\u90e8\u5206\uff08\u5982\u5339\u914d\u2018magic\u2019\uff0c\u800c\u4e0d\u662f\u2018magical\u2019\uff09<br \/>\ngrep -C number pattern files \uff1a\u5339\u914d\u7684\u4e0a\u4e0b\u6587\u5206\u522b\u663e\u793a[number]\u884c<br \/>\ngrep pattern1 | pattern2 files \uff1a\u663e\u793a\u5339\u914d pattern1 \u6216 pattern2 \u7684\u884c<br \/>\ngrep pattern1 files | grep pattern2 \uff1a\u663e\u793a\u65e2\u5339\u914d pattern1 \u53c8\u5339\u914d pattern2 \u7684\u884c<\/p>\n<p>\u7528\u4e8e\u641c\u7d22\u7684\u7279\u6b8a\u7b26\u53f7\uff1a &lt; \u548c &gt; \u5206\u522b\u6807\u6ce8\u5355\u8bcd\u7684\u5f00\u59cb\u4e0e\u7ed3\u5c3e\u3002<br \/>\n\u4f8b\u5982\uff1a grep man * \u4f1a\u5339\u914d \u2018Batman\u2019\u3001\u2018manic\u2019\u3001\u2018man\u2019\u7b49 grep \u2018&lt;man\u2019 * \u5339\u914d\u2018manic\u2019\u548c\u2018man\u2019\uff0c\u4f46\u4e0d\u662f\u2018Batman\u2019<br \/>\ngrep \u2018&lt;man&gt;\u2019 \u53ea\u5339\u914d\u2018man\u2019\uff0c\u800c\u4e0d\u662f\u2018Batman\u2019\u6216\u2018manic\u2019\u7b49\u5176\u4ed6\u7684\u5b57\u7b26\u4e32\u3002<br \/>\n\u2018^\u2019\uff1a\u6307\u5339\u914d\u7684\u5b57\u7b26\u4e32\u5728\u884c\u9996<br \/>\n\u2018$\u2019\uff1a\u6307\u5339\u914d\u7684\u5b57\u7b26\u4e32\u5728\u884c\u5c3e<\/p>\n<p>\u8fd9\u91cc\u5bf9Linux\u4e0b\u4f7f\u7528git\u547d\u4ee4\u505a\u4e00\u4e2a\u8be6\u7ec6\u7684\u89e3\u6790\uff1a<br \/>\n\u63d0\u4ea4\u4ee3\u7801\uff1a<br \/>\n\uff081\uff09git pull aosp main\/svw_cns3.0_dev<br \/>\n\uff082\uff09git add xxx<br \/>\n\uff083\uff09git commit -m \u201c[MediaTest]Repair click events without noise and related problems\u201d<br \/>\n\uff084\uff09git push aosp HEAD:refs\/for\/main\/svw_cns3.0_dev<\/p>\n<p>\u5220\u9664\u6587\u4ef6\uff1agit rm xxx\u3002<\/p>\n<p>\u67e5\u770bgit log\u4e2d\u67d0\u4e00\u6b21\u5177\u4f53\u63d0\u4ea4\u7684\u5185\u5bb9\uff1a\u5148git log\u67e5commit\u7684id\uff0c\u7136\u540egit log commit\u7684id -p -1\u3002<\/p>\n<p>git\u56de\u9000\u5230\u4e0a\u4e00\u4e2a\u7248\u672c\uff1agit reset &#8211;hard HEAD^\u3002 \u56de\u9000\u5230\u4e0a\u4e0a\u4e2a\u7248\u672c\uff1agit reset &#8211;hard HEAD^^\u3002<\/p>\n<p>git\u5220\u9664\u4e0a\u6b21\u63d0\u4ea4\u4e2d\u7684\u67d0\u4e2a\u6587\u4ef6\uff08Android.mk~\uff09\u518d\u91cd\u65b0\u63d0\u4ea4\uff1a<\/p>\n<p>rm -rf NetworkConnectionsTest\/Android.mk~<\/p>\n<p>git status<\/p>\n<p>git rm NetworkConnectionsTest\/Android.mk~<\/p>\n<p>git commit &#8211;amend<\/p>\n<p>git push aosp HEAD:refs\/for\/main\/svw_cns3.0_dev<\/p>\n<p>\u6302\u8f7d\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf<br \/>\nmount \/dev\/hda2 \/mnt\/hda2 \u6302\u8f7d\u4e00\u4e2a\u53eb\u505ahda2\u7684\u76d8 &#8211; \u786e\u5b9a\u76ee\u5f55 \u2018\/ mnt\/hda2\u2019 \u5df2\u7ecf\u5b58\u5728<br \/>\numount \/dev\/hda2 \u5378\u8f7d\u4e00\u4e2a\u53eb\u505ahda2\u7684\u76d8 &#8211; \u5148\u4ece\u6302\u8f7d\u70b9 \u2018\/ mnt\/hda2\u2019 \u9000\u51fa<br \/>\nfuser -km \/mnt\/hda2 \u5f53\u8bbe\u5907\u7e41\u5fd9\u65f6\u5f3a\u5236\u5378\u8f7d<br \/>\numount -n \/mnt\/hda2 \u8fd0\u884c\u5378\u8f7d\u64cd\u4f5c\u800c\u4e0d\u5199\u5165 \/etc\/mtab \u6587\u4ef6- \u5f53\u6587\u4ef6\u4e3a\u53ea\u8bfb\u6216\u5f53\u78c1\u76d8\u5199\u6ee1\u65f6\u975e\u5e38\u6709\u7528<br \/>\nmount \/dev\/fd0 \/mnt\/floppy \u6302\u8f7d\u4e00\u4e2a\u8f6f\u76d8<br \/>\nmount \/dev\/cdrom \/mnt\/cdrom \u6302\u8f7d\u4e00\u4e2acdrom\u6216dvdrom<br \/>\nmount \/dev\/hdc \/mnt\/cdrecorder \u6302\u8f7d\u4e00\u4e2acdrw\u6216dvdrom<br \/>\nmount \/dev\/hdb \/mnt\/cdrecorder \u6302\u8f7d\u4e00\u4e2acdrw\u6216dvdrom<br \/>\nmount -o loop file.iso \/mnt\/cdrom \u6302\u8f7d\u4e00\u4e2a\u6587\u4ef6\u6216ISO\u955c\u50cf\u6587\u4ef6<br \/>\nmount -t vfat \/dev\/hda5 \/mnt\/hda5 \u6302\u8f7d\u4e00\u4e2aWindows FAT32\u6587\u4ef6\u7cfb\u7edf<br \/>\nmount \/dev\/sda1 \/mnt\/usbdisk \u6302\u8f7d\u4e00\u4e2ausb \u6377\u76d8\u6216\u95ea\u5b58\u8bbe\u5907<br \/>\nmount -t smbfs -o username=user,password=pass \/\/WinClient\/share \/mnt\/share \u6302\u8f7d\u4e00\u4e2awindows\u7f51\u7edc\u5171\u4eab<\/p>\n<p>\u600e\u4e48\u67e5\u770b(\u5305\u62ec\u6ca1\u6709\u6302\u8f7d\u7684)\u786c\u76d8\u4f7f\u7528\u60c5\u51b5<br \/>\n\u7b2c\u4e00\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528df-h\u547d\u4ee4\uff0c\u8fd9\u4e2a\u547d\u4ee4\u6bd4\u8f83\u5e38\u7528\uff0c\u5927\u5bb6\u90fd\u5f88\u719f\u6089\u3002\u95ee\u9898\u662f\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6709\u65f6\u5019\u6302\u8f7d\u70b9\u548c\u6302\u8f7d\u7684\u5377\u4e0d\u5728\u540c\u4e00\u884c\uff0c\u4f7f\u7528\u811a\u672c\u5206\u6790\u9700\u8981\u4e00\u70b9\u6280\u5de7\u7684\u3002<br \/>\n\u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528mount\u547d\u4ee4\uff0cmount -l\uff0c\u8fd9\u79cd\u65b9\u6cd5\u7684\u7f3a\u9677\u5728\u4e8e\u6ca1\u6709\u5377\u7684\u5927\u5c0f\uff0c\u4f46\u662f\u6302\u8f7d\u70b9\u548c\u6302\u8f7d\u7684\u5377\u5728\u540c\u4e00\u884c\u3002<br \/>\n\u7b2c\u4e09\u79cd\u65b9\u6cd5\uff1a\u67e5\u770b\u6587\u4ef6\/etc\/mtab\u3002\u539f\u7406\u662f\uff0c\u6bcf\u65b0\u6302\u8f7d\u4e00\u4e2a\u5377\u57fa\u672c\u4e0a\u90fd\u4f1a\u66f4\u65b0\u8fd9\u4e2a\u6587\u4ef6\u7684\uff0c\u90a3\u4e48\u81ea\u7136\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u6765\u67e5\u770b\u6302\u8f7d\u70b9\u548c\u6302\u804c\u7684\u5377\u3002\u8fd9\u79cd\u65b9\u6cd5\u6bd4mount -l\u7a0d\u5fae\u6e05\u6670\u4e86\u4e00\u70b9\uff0c\u4f46\u662f\uff0c\u6709\u65f6\u5019\u662f\u4e0d\u53ef\u9760\u7684\u3002<\/p>\n<p>\/etc\/fstab\u548c\/etc\/mtab\u7684\u533a\u522b<br \/>\n\/etc\/fstab\u6587\u4ef6\u7684\u4f5c\u7528:<\/p>\n<p>\u8bb0\u5f55\u4e86\u8ba1\u7b97\u673a\u4e0a\u786c\u76d8\u5206\u533a\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u542f\u52a8 Linux \u7684\u65f6\u5019\uff0c\u68c0\u67e5\u5206\u533a\u7684 fsck \u547d\u4ee4\uff0c\u548c\u6302\u8f7d\u5206\u533a\u7684 mount \u547d\u4ee4\uff0c\u90fd\u9700\u8981 fstab \u4e2d\u7684\u4fe1\u606f\uff0c\u6765\u6b63\u786e\u7684\u68c0\u67e5\u548c\u6302\u8f7d\u786c\u76d8\u3002<\/p>\n<p>\/etc\/mtab\u6587\u4ef6\u7684\u4f5c\u7528\uff1a<\/p>\n<p>\u5148\u770b\u5b83\u7684\u82f1\u6587\u662f:<br \/>\nThis changes continuously as the file \/proc\/mount changes. In other words, when filesystems are mounted and unmounted, the change is immediately reflected in this file.<\/p>\n<p>\u8bb0\u8f7d\u7684\u662f\u73b0\u5728\u7cfb\u7edf\u5df2\u7ecf\u88c5\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u5305\u62ec\u64cd\u4f5c\u7cfb\u7edf\u5efa\u7acb\u7684\u865a\u62df\u6587\u4ef6\u7b49\uff1b\u800c\/etc\/fstab\u662f\u7cfb\u7edf\u51c6\u5907\u88c5\u8f7d\u7684\u3002 \u6bcf\u5f53 mount \u6302\u8f7d\u5206\u533a\u3001umount \u5378\u8f7d\u5206\u533a\uff0c\u90fd\u4f1a\u52a8\u6001\u66f4\u65b0 mtab\uff0cmtab \u603b\u662f\u4fdd\u6301\u7740\u5f53\u524d\u7cfb\u7edf\u4e2d\u5df2\u6302\u8f7d\u7684\u5206\u533a\u4fe1\u606f\uff0cfdisk\u3001df \u8fd9\u7c7b\u7a0b\u5e8f\uff0c\u5fc5\u987b\u8981\u8bfb\u53d6 mtab \u6587\u4ef6\uff0c\u624d\u80fd\u83b7\u5f97\u5f53\u524d\u7cfb\u7edf\u4e2d\u7684\u5206\u533a\u6302\u8f7d\u60c5\u51b5\u3002\u5f53\u7136\u6211\u4eec\u81ea\u5df1\u8fd8\u53ef\u4ee5\u901a\u8fc7\u8bfb\u53d6\/proc\/mount\u4e5f\u53ef\u4ee5\u6765\u83b7\u53d6\u5f53\u524d\u6302\u8f7d\u4fe1\u606f<\/p>\n<p>\u78c1\u76d8\u7a7a\u95f4<br \/>\ndf -h \u663e\u793a\u5df2\u7ecf\u6302\u8f7d\u7684\u5206\u533a\u5217\u8868<br \/>\nls -lSr |more \u4ee5\u5c3a\u5bf8\u5927\u5c0f\u6392\u5217\u6587\u4ef6\u548c\u76ee\u5f55<br \/>\ndu -sh dir1 \u4f30\u7b97\u76ee\u5f55 \u2018dir1\u2019 \u5df2\u7ecf\u4f7f\u7528\u7684\u78c1\u76d8\u7a7a\u95f4\u2019<br \/>\ndu -sk * | sort -rn \u4ee5\u5bb9\u91cf\u5927\u5c0f\u4e3a\u4f9d\u636e\u4f9d\u6b21\u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5927\u5c0f<br \/>\nrpm -q -a &#8211;qf \u2018%10{SIZE}t%{NAME}n\u2019 | sort -k1,1n \u4ee5\u5927\u5c0f\u4e3a\u4f9d\u636e\u4f9d\u6b21\u663e\u793a\u5df2\u5b89\u88c5\u7684rpm\u5305\u6240\u4f7f\u7528\u7684\u7a7a\u95f4 (fedora, redhat\u7c7b\u7cfb\u7edf)<br \/>\ndpkg-query -W -f=\u2019I n s t a l l e d \u2212 S i z e ; 10 t {Installed-Size;10}tInstalled\u2212Size;10t{Package}n\u2019 | sort -k1,1n \u4ee5\u5927\u5c0f\u4e3a\u4f9d\u636e\u663e\u793a\u5df2\u5b89\u88c5\u7684deb\u5305\u6240\u4f7f\u7528\u7684\u7a7a\u95f4 (ubuntu, debian\u7c7b\u7cfb\u7edf)<\/p>\n<p>\u7528\u6237\u548c\u7fa4\u7ec4<br \/>\ngroupadd group_name \u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237\u7ec4<br \/>\ngroupdel group_name \u5220\u9664\u4e00\u4e2a\u7528\u6237\u7ec4<br \/>\ngroupmod -n new_group_name old_group_name \u91cd\u547d\u540d\u4e00\u4e2a\u7528\u6237\u7ec4<br \/>\nuseradd -c &#8220;Name Surname &#8221; -g admin -d \/home\/user1 -s \/bin\/bash user1 \u521b\u5efa\u4e00\u4e2a\u5c5e\u4e8e \u201cadmin\u201d \u7528\u6237\u7ec4\u7684\u7528\u6237<br \/>\nuseradd user1 \u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237<br \/>\nuserdel -r user1 \u5220\u9664\u4e00\u4e2a\u7528\u6237 ( \u2018-r\u2019 \u6392\u9664\u4e3b\u76ee\u5f55)<br \/>\nusermod -c \u201cUser FTP\u201d -g system -d \/ftp\/user1 -s \/bin\/nologin user1 \u4fee\u6539\u7528\u6237\u5c5e\u6027<br \/>\npasswd \u4fee\u6539\u53e3\u4ee4<br \/>\npasswd user1 \u4fee\u6539\u4e00\u4e2a\u7528\u6237\u7684\u53e3\u4ee4 (\u53ea\u5141\u8bb8root\u6267\u884c)<br \/>\nchage -E 2005-12-31 user1 \u8bbe\u7f6e\u7528\u6237\u53e3\u4ee4\u7684\u5931\u6548\u671f\u9650<br \/>\npwck \u68c0\u67e5 \u2018\/etc\/passwd\u2019 \u7684\u6587\u4ef6\u683c\u5f0f\u548c\u8bed\u6cd5\u4fee\u6b63\u4ee5\u53ca\u5b58\u5728\u7684\u7528\u6237<br \/>\ngrpck \u68c0\u67e5 \u2018\/etc\/passwd\u2019 \u7684\u6587\u4ef6\u683c\u5f0f\u548c\u8bed\u6cd5\u4fee\u6b63\u4ee5\u53ca\u5b58\u5728\u7684\u7fa4\u7ec4<br \/>\nnewgrp group_name \u767b\u9646\u8fdb\u4e00\u4e2a\u65b0\u7684\u7fa4\u7ec4\u4ee5\u6539\u53d8\u65b0\u521b\u5efa\u6587\u4ef6\u7684\u9884\u8bbe\u7fa4\u7ec4<\/p>\n<p>\u6587\u4ef6\u7684\u6743\u9650 &#8211; \u4f7f\u7528 \u201c+\u201d \u8bbe\u7f6e\u6743\u9650\uff0c\u4f7f\u7528 \u201c-\u201d \u7528\u4e8e\u53d6\u6d88<br \/>\nls -lh \u663e\u793a\u6743\u9650<br \/>\nls \/tmp | pr -T5 -W$COLUMNS \u5c06\u7ec8\u7aef\u5212\u5206\u62105\u680f\u663e\u793a<br \/>\nchmod ugo+rwx directory1 \u8bbe\u7f6e\u76ee\u5f55\u7684\u6240\u6709\u4eba(u)\u3001\u7fa4\u7ec4(g)\u4ee5\u53ca\u5176\u4ed6\u4eba(o)\u4ee5\u8bfb\uff08r \uff09\u3001\u5199(w)\u548c\u6267\u884c(x)\u7684\u6743\u9650<br \/>\nchmod go-rwx directory1 \u5220\u9664\u7fa4\u7ec4(g)\u4e0e\u5176\u4ed6\u4eba(o)\u5bf9\u76ee\u5f55\u7684\u8bfb\u5199\u6267\u884c\u6743\u9650<br \/>\nchown user1 file1 \u6539\u53d8\u4e00\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u4eba\u5c5e\u6027<br \/>\nchown -R user1 directory1 \u6539\u53d8\u4e00\u4e2a\u76ee\u5f55\u7684\u6240\u6709\u4eba\u5c5e\u6027\u5e76\u540c\u65f6\u6539\u53d8\u6539\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u7684\u5c5e\u6027<br \/>\nchgrp group1 file1 \u6539\u53d8\u6587\u4ef6\u7684\u7fa4\u7ec4<br \/>\nchown user1:group1 file1 \u6539\u53d8\u4e00\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u4eba\u548c\u7fa4\u7ec4\u5c5e\u6027<br \/>\nfind \/ -perm -u+s \u7f57\u5217\u4e00\u4e2a\u7cfb\u7edf\u4e2d\u6240\u6709\u4f7f\u7528\u4e86SUID\u63a7\u5236\u7684\u6587\u4ef6<br \/>\nchmod u+s \/bin\/file1 \u8bbe\u7f6e\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684 SUID \u4f4d &#8211; \u8fd0\u884c\u8be5\u6587\u4ef6\u7684\u7528\u6237\u4e5f\u88ab\u8d4b\u4e88\u548c\u6240\u6709\u8005\u540c\u6837\u7684\u6743\u9650<br \/>\nchmod u-s \/bin\/file1 \u7981\u7528\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684 SUID\u4f4d<br \/>\nchmod g+s \/home\/public \u8bbe\u7f6e\u4e00\u4e2a\u76ee\u5f55\u7684SGID \u4f4d &#8211; \u7c7b\u4f3cSUID \uff0c\u4e0d\u8fc7\u8fd9\u662f\u9488\u5bf9\u76ee\u5f55\u7684<br \/>\nchmod g-s \/home\/public \u7981\u7528\u4e00\u4e2a\u76ee\u5f55\u7684 SGID \u4f4d<br \/>\nchmod o+t \/home\/public \u8bbe\u7f6e\u4e00\u4e2a\u6587\u4ef6\u7684 STIKY \u4f4d &#8211; \u53ea\u5141\u8bb8\u5408\u6cd5\u6240\u6709\u4eba\u5220\u9664\u6587\u4ef6<br \/>\nchmod o-t \/home\/public \u7981\u7528\u4e00\u4e2a\u76ee\u5f55\u7684 STIKY \u4f4d<\/p>\n<p>\u6587\u4ef6\u7684\u7279\u6b8a\u5c5e\u6027 &#8211; \u4f7f\u7528 \u201c+\u201d \u8bbe\u7f6e\u6743\u9650\uff0c\u4f7f\u7528 \u201c-\u201d \u7528\u4e8e\u53d6\u6d88<br \/>\nchattr +a file1 \u53ea\u5141\u8bb8\u4ee5\u8ffd\u52a0\u65b9\u5f0f\u8bfb\u5199\u6587\u4ef6<br \/>\nchattr +c file1 \u5141\u8bb8\u8fd9\u4e2a\u6587\u4ef6\u80fd\u88ab\u5185\u6838\u81ea\u52a8\u538b\u7f29\/\u89e3\u538b<br \/>\nchattr +d file1 \u5728\u8fdb\u884c\u6587\u4ef6\u7cfb\u7edf\u5907\u4efd\u65f6\uff0cdump\u7a0b\u5e8f\u5c06\u5ffd\u7565\u8fd9\u4e2a\u6587\u4ef6<br \/>\nchattr +i file1 \u8bbe\u7f6e\u6210\u4e0d\u53ef\u53d8\u7684\u6587\u4ef6\uff0c\u4e0d\u80fd\u88ab\u5220\u9664\u3001\u4fee\u6539\u3001\u91cd\u547d\u540d\u6216\u8005\u94fe\u63a5<br \/>\nchattr +s file1 \u5141\u8bb8\u4e00\u4e2a\u6587\u4ef6\u88ab\u5b89\u5168\u5730\u5220\u9664<br \/>\nchattr +S file1 \u4e00\u65e6\u5e94\u7528\u7a0b\u5e8f\u5bf9\u8fd9\u4e2a\u6587\u4ef6\u6267\u884c\u4e86\u5199\u64cd\u4f5c\uff0c\u4f7f\u7cfb\u7edf\u7acb\u523b\u628a\u4fee\u6539\u7684\u7ed3\u679c\u5199\u5230\u78c1\u76d8<br \/>\nchattr +u file1 \u82e5\u6587\u4ef6\u88ab\u5220\u9664\uff0c\u7cfb\u7edf\u4f1a\u5141\u8bb8\u4f60\u5728\u4ee5\u540e\u6062\u590d\u8fd9\u4e2a\u88ab\u5220\u9664\u7684\u6587\u4ef6<br \/>\nlsattr \u663e\u793a\u7279\u6b8a\u7684\u5c5e\u6027<\/p>\n<p>\u6253\u5305\u548c\u538b\u7f29\u6587\u4ef6<br \/>\nbunzip2 file1.bz2 \u89e3\u538b\u4e00\u4e2a\u53eb\u505a &#8216;file1.bz2\u2019\u7684\u6587\u4ef6<br \/>\nbzip2 file1 \u538b\u7f29\u4e00\u4e2a\u53eb\u505a \u2018file1\u2019 \u7684\u6587\u4ef6<br \/>\ngunzip file1.gz \u89e3\u538b\u4e00\u4e2a\u53eb\u505a &#8216;file1.gz\u2019\u7684\u6587\u4ef6<br \/>\ngzip file1 \u538b\u7f29\u4e00\u4e2a\u53eb\u505a &#8216;file1\u2019\u7684\u6587\u4ef6<br \/>\ngzip -9 file1 \u6700\u5927\u7a0b\u5ea6\u538b\u7f29<br \/>\nrar a file1.rar test_file \u521b\u5efa\u4e00\u4e2a\u53eb\u505a \u2018file1.rar\u2019 \u7684\u5305<br \/>\nrar a file1.rar file1 file2 dir1 \u540c\u65f6\u538b\u7f29 \u2018file1\u2019, \u2018file2\u2019 \u4ee5\u53ca\u76ee\u5f55 \u2018dir1\u2019<br \/>\nrar x file1.rar \u89e3\u538brar\u5305<br \/>\nunrar x file1.rar \u89e3\u538brar\u5305<br \/>\ntar -cvf archive.tar file1 \u521b\u5efa\u4e00\u4e2a\u975e\u538b\u7f29\u7684 tarball<br \/>\ntar -cvf archive.tar file1 file2 dir1 \u521b\u5efa\u4e00\u4e2a\u5305\u542b\u4e86 \u2018file1\u2019, \u2018file2\u2019 \u4ee5\u53ca &#8216;dir1\u2019\u7684\u6863\u6848\u6587\u4ef6<br \/>\ntar -tf archive.tar \u663e\u793a\u4e00\u4e2a\u5305\u4e2d\u7684\u5185\u5bb9<br \/>\ntar -xvf archive.tar \u91ca\u653e\u4e00\u4e2a\u5305<br \/>\ntar -xvf archive.tar -C \/tmp \u5c06\u538b\u7f29\u5305\u91ca\u653e\u5230 \/tmp\u76ee\u5f55\u4e0b<br \/>\ntar -cvfj archive.tar.bz2 dir1 \u521b\u5efa\u4e00\u4e2abzip2\u683c\u5f0f\u7684\u538b\u7f29\u5305<br \/>\ntar -jxvf archive.tar.bz2 \u89e3\u538b\u4e00\u4e2abzip2\u683c\u5f0f\u7684\u538b\u7f29\u5305<br \/>\ntar -cvfz archive.tar.gz dir1 \u521b\u5efa\u4e00\u4e2agzip\u683c\u5f0f\u7684\u538b\u7f29\u5305<br \/>\ntar -zxvf archive.tar.gz \u89e3\u538b\u4e00\u4e2agzip\u683c\u5f0f\u7684\u538b\u7f29\u5305<br \/>\nzip file1.zip file1 \u521b\u5efa\u4e00\u4e2azip\u683c\u5f0f\u7684\u538b\u7f29\u5305<br \/>\nzip -r file1.zip file1 file2 dir1 \u5c06\u51e0\u4e2a\u6587\u4ef6\u548c\u76ee\u5f55\u540c\u65f6\u538b\u7f29\u6210\u4e00\u4e2azip\u683c\u5f0f\u7684\u538b\u7f29\u5305<br \/>\nunzip file1.zip \u89e3\u538b\u4e00\u4e2azip\u683c\u5f0f\u538b\u7f29\u5305<\/p>\n<p>\u8fd9\u91cc\u5bf9\u538b\u7f29\u6587\u6863\u548c\u89e3\u538b\u6587\u6863\u505a\u4e2a\u8be6\u7ec6\u7684\u4ecb\u7ecd\uff1a<br \/>\ntar -zcvf \/home\/xahot.tar.gz \/xahot<br \/>\ntar -zcvf \u6253\u5305\u540e\u751f\u6210\u7684\u6587\u4ef6\u540d\u5168\u8def\u5f84 \u8981\u6253\u5305\u7684\u76ee\u5f55<br \/>\n\u4f8b\u5b50\uff1a\u628a\/xahot\u6587\u4ef6\u5939\u6253\u5305\u540e\u751f\u6210\u4e00\u4e2a\/home\/xahot.tar.gz\u7684\u6587\u4ef6\u3002<br \/>\nzip \u538b\u7f29\u65b9\u6cd5\uff1a<\/p>\n<p>\u538b\u7f29\u5f53\u524d\u7684\u6587\u4ef6\u5939 zip -r .\/xahot.zip .\/* -r\u8868\u793a\u9012\u5f52<br \/>\nzip [\u53c2\u6570] [\u6253\u5305\u540e\u7684\u6587\u4ef6\u540d] [\u6253\u5305\u7684\u76ee\u5f55\u8def\u5f84]<br \/>\n\u89e3\u538b unzip xahot.zip \u4e0d\u89e3\u91ca<br \/>\nlinux zip\u547d\u4ee4\u7684\u57fa\u672c\u7528\u6cd5\u662f\uff1a<\/p>\n<p>linux zip\u547d\u4ee4\u53c2\u6570\u5217\u8868\uff1a<\/p>\n<p>-a \u5c06\u6587\u4ef6\u8f6c\u6210ASCII\u6a21\u5f0f<br \/>\n-F \u5c1d\u8bd5\u4fee\u590d\u635f\u574f\u7684\u538b\u7f29\u6587\u4ef6<br \/>\n-h \u663e\u793a\u5e2e\u52a9\u754c\u9762<br \/>\n-m \u5c06\u6587\u4ef6\u538b\u7f29\u4e4b\u540e\uff0c\u5220\u9664\u6e90\u6587\u4ef6<\/p>\n<p>-n \u7279\u5b9a\u5b57\u7b26\u4e32 \u4e0d\u538b\u7f29\u5177\u6709\u7279\u5b9a\u5b57\u5c3e\u5b57\u7b26\u4e32\u7684\u6587\u4ef6<br \/>\n-o \u5c06\u538b\u7f29\u6587\u4ef6\u5185\u7684\u6240\u6709\u6587\u4ef6\u7684\u6700\u65b0\u53d8\u52a8\u65f6\u95f4\u8bbe\u4e3a\u538b\u7f29\u65f6\u5019\u7684\u65f6\u95f4<br \/>\n-q \u5b89\u9759\u6a21\u5f0f\uff0c\u5728\u538b\u7f29\u7684\u65f6\u5019\u4e0d\u663e\u793a\u6307\u4ee4\u7684\u6267\u884c\u8fc7\u7a0b<br \/>\n-r \u5c06\u6307\u5b9a\u7684\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u5b50\u76ee\u5f55\u4ee5\u53ca\u6587\u4ef6\u4e00\u8d77\u5904\u7406<br \/>\n-S \u5305\u542b\u7cfb\u7edf\u6587\u4ef6\u548c\u9690\u542b\u6587\u4ef6\uff08S\u662f\u5927\u5199\uff09<br \/>\n-t \u65e5\u671f \u628a\u538b\u7f29\u6587\u4ef6\u7684\u6700\u540e\u4fee\u6539\u65e5\u671f\u8bbe\u4e3a\u6307\u5b9a\u7684\u65e5\u671f\uff0c\u65e5\u671f\u683c\u5f0f\u4e3ammddyyyy<\/p>\n<p>\u4e3e\u4f8b\uff1a<\/p>\n<p>\u5c06\/home\/wwwroot\/xahot\/ \u8fd9\u4e2a\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u6253\u5305\u4e3a\u5f53\u524d\u76ee\u5f55\u4e0b\u7684xahot.zip<\/p>\n<p>zip \u2013q \u2013r xahot.zip \/home\/wwwroot\/xahot<\/p>\n<p>\u4e0a\u9762\u7684\u547d\u4ee4\u64cd\u4f5c\u662f\u5c06\u7edd\u5bf9\u5730\u5740\u7684\u6587\u4ef6\u53ca\u6587\u4ef6\u5939\u8fdb\u884c\u538b\u7f29.\u4ee5\u4e0b\u7ed9\u51fa\u538b\u7f29\u76f8\u5bf9\u8def\u5f84\u76ee\u5f55<\/p>\n<p>\u6bd4\u5982\u76ee\u524d\u5728Bliux\u8fd9\u4e2a\u76ee\u5f55\u4e0b,\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\u53ef\u4ee5\u8fbe\u5230\u4ee5\u4e0a\u540c\u6837\u7684\u6548\u679c.<\/p>\n<p>zip \u2013q \u2013r xahot.zip xahot<\/p>\n<p>\u6bd4\u5982\u73b0\u5728\u6211\u7684xahot\u76ee\u5f55\u4e0b,\u6211\u64cd\u4f5c\u7684zip\u538b\u7f29\u547d\u4ee4\u662f<\/p>\n<p>zip \u2013q \u2013r xahot.zip *<\/p>\n<p>\u4ee5\u4e0a\u662f\u5728\u5b89\u9759\u6a21\u5f0f\u4e0b\u8fdb\u884c\u7684\uff0c\u800c\u4e14\u5305\u542b\u7cfb\u7edf\u6587\u4ef6\u548c\u9690\u542b\u6587\u4ef6<br \/>\n\/\/<br \/>\nunzip\u8bed \u6cd5\uff1a<\/p>\n<p>unzip [-cflptuvz][-agCjLMnoqsVX][-P &lt;\u5bc6\u7801&gt;][.zip\u6587\u4ef6][\u6587\u4ef6][-d &lt;\u76ee \u5f55&gt;][-x &lt;\u6587\u4ef6&gt;] \u6216 unzip [-Z]<\/p>\n<p>\u8865\u5145\u8bf4\u660e\uff1aunzip\u4e3a.zip\u538b\u7f29\u6587\u4ef6\u7684\u89e3\u538b\u7f29\u7a0b\u5e8f\u3002<\/p>\n<p>unzip\u53c2 \u6570\uff1a<br \/>\n-c \u5c06\u89e3\u538b\u7f29\u7684\u7ed3\u679c\u663e\u793a\u5230\u5c4f\u5e55\u4e0a\uff0c\u5e76\u5bf9\u5b57\u7b26\u505a\u9002\u5f53\u7684\u8f6c\u6362\u3002<br \/>\n-f \u66f4\u65b0\u73b0\u6709\u7684\u6587\u4ef6\u3002<br \/>\n-l \u663e\u793a\u538b\u7f29\u6587\u4ef6\u5185\u6240\u5305\u542b\u7684\u6587\u4ef6\u3002<br \/>\n-p \u4e0e-c\u53c2\u6570\u7c7b\u4f3c\uff0c\u4f1a\u5c06\u89e3\u538b\u7f29\u7684\u7ed3\u679c\u663e\u793a\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u7684\u8f6c\u6362\u3002<br \/>\n-t \u68c0\u67e5\u538b\u7f29\u6587\u4ef6\u662f\u5426\u6b63\u786e\u3002<br \/>\n-u \u4e0e-f\u53c2\u6570\u7c7b\u4f3c\uff0c\u4f46\u662f\u9664\u4e86\u66f4\u65b0\u73b0\u6709\u7684\u6587\u4ef6\u5916\uff0c\u4e5f\u4f1a\u5c06\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u5176\u4ed6\u6587\u4ef6\u89e3\u538b\u7f29\u5230\u76ee\u5f55\u4e2d\u3002<br \/>\n-v \u6267\u884c\u662f\u65f6\u663e\u793a\u8be6\u7ec6\u7684\u4fe1\u606f\u3002<br \/>\n-z \u4ec5\u663e\u793a\u538b\u7f29\u6587\u4ef6\u7684\u5907\u6ce8\u6587\u5b57\u3002<br \/>\n-a \u5bf9\u6587\u672c\u6587\u4ef6\u8fdb\u884c\u5fc5\u8981\u7684\u5b57\u7b26\u8f6c\u6362\u3002<br \/>\n-b \u4e0d\u8981\u5bf9\u6587\u672c\u6587\u4ef6\u8fdb\u884c\u5b57\u7b26\u8f6c\u6362\u3002<br \/>\n-C \u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u6587\u4ef6\u540d\u79f0\u533a\u5206\u5927\u5c0f\u5199\u3002<br \/>\n-j \u4e0d\u5904\u7406\u538b\u7f29\u6587\u4ef6\u4e2d\u539f\u6709\u7684\u76ee\u5f55\u8def\u5f84\u3002<br \/>\n-L \u5c06\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u5168\u90e8\u6587\u4ef6\u540d\u6539\u4e3a\u5c0f\u5199\u3002<br \/>\n-M \u5c06\u8f93\u51fa\u7ed3\u679c\u9001\u5230more\u7a0b\u5e8f\u5904\u7406\u3002<br \/>\n-n \u89e3\u538b\u7f29\u65f6\u4e0d\u8981\u8986\u76d6\u539f\u6709\u7684\u6587\u4ef6\u3002<br \/>\n-o \u4e0d\u5fc5\u5148\u8be2\u95ee\u7528\u6237\uff0cunzip\u6267\u884c\u540e\u8986\u76d6\u539f\u6709\u6587\u4ef6\u3002<br \/>\n-P&lt;\u5bc6\u7801&gt; \u4f7f\u7528zip\u7684\u5bc6\u7801\u9009\u9879\u3002<br \/>\n-q \u6267\u884c\u65f6\u4e0d\u663e\u793a\u4efb\u4f55\u4fe1\u606f\u3002<br \/>\n-s \u5c06\u6587\u4ef6\u540d\u4e2d\u7684\u7a7a\u767d\u5b57\u7b26\u8f6c\u6362\u4e3a\u5e95\u7ebf\u5b57\u7b26\u3002<br \/>\n-V \u4fdd\u7559VMS\u7684\u6587\u4ef6\u7248\u672c\u4fe1\u606f\u3002<br \/>\n-X \u89e3\u538b\u7f29\u65f6\u540c\u65f6\u56de\u5b58\u6587\u4ef6\u539f\u6765\u7684UID\/GID\u3002<br \/>\n[.zip\u6587\u4ef6] \u6307\u5b9a.zip\u538b\u7f29\u6587\u4ef6\u3002<br \/>\n[\u6587\u4ef6] \u6307\u5b9a\u8981\u5904\u7406.zip\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u54ea\u4e9b\u6587\u4ef6\u3002<br \/>\n-d&lt;\u76ee\u5f55&gt; \u6307\u5b9a\u6587\u4ef6\u89e3\u538b\u7f29\u540e\u6240\u8981\u5b58\u50a8\u7684\u76ee\u5f55\u3002<br \/>\n-x&lt;\u6587\u4ef6&gt; \u6307\u5b9a\u4e0d\u8981\u5904\u7406.zip\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u54ea\u4e9b\u6587\u4ef6\u3002<br \/>\n-Z unzip -Z\u7b49\u4e8e\u6267\u884czipinfo\u6307\u4ee4<\/p>\n<p>\u4e3e\u4f8b\uff1a<\/p>\n<p>\u5c06\/home\/wwwroot\/xahot.zip\u89e3\u538b\u5230\u5f53\u524d\u76ee\u5f55<\/p>\n<p>unzip xahot.zip<\/p>\n<p>\u5982\u679c\u51fa\u73b0\u8fd9\u4e2a\u63d0\u793a\uff1a<br \/>\n-bash: zip: command not found \u4e0d\u80fd\u6267\u884cZIP\u538b\u7f29\uff0c\u662f\u56e0\u4e3a\u6ca1\u6709\u5b89\u88c5ZIP\uff0c<br \/>\n\u8fd0\u884c\u4e0b\u8fd9\u6761\u5b89\u88c5\u547d\u4ee4\u5373\u53ef yum install zip<\/p>\n<p>==============================================================<\/p>\n<p>tar -cvf \/usr\/local\/auto_bak\/test.tar \/usr\/local\/test \u4ec5\u6253\u5305\uff0c\u4e0d\u538b\u7f29<\/p>\n<p>tar -zcvf \/usr\/local\/auto_bak\/test.tar.gz \/usr\/local\/test \u6253\u5305\u540e\uff0c\u4ee5gzip\u538b\u7f29 \u5728\u53c2\u6570f\u540e\u9762\u7684\u538b\u7f29\u6587\u4ef6\u540d\u662f\u81ea\u5df1\u53d6\u7684\uff0c\u4e60\u60ef\u4e0a\u7528tar\u6765\u505a\uff0c\u5982\u679c\u52a0z\u53c2\u6570\uff0c\u5219\u4ee5tar.gz \u6216tgz\u6765\u4ee3\u8868gzip\u538b\u7f29\u8fc7\u7684tar file\u6587\u4ef6<br \/>\n\u89e3\u538b\u64cd\u4f5c:<br \/>\n#tar -zxvf \/usr\/local\/test.tar.gz<br \/>\ntar \u89e3\u538b\u7f29\u547d\u4ee4\u8be6\u89e3<br \/>\n-c: \u5efa\u7acb\u538b\u7f29\u6863\u6848<\/p>\n<p>-x\uff1a\u89e3\u538b<br \/>\n-t\uff1a\u67e5\u770b\u5185\u5bb9<br \/>\n-r\uff1a\u5411\u538b\u7f29\u5f52\u6863\u6587\u4ef6\u672b\u5c3e\u8ffd\u52a0\u6587\u4ef6<br \/>\n-u\uff1a\u66f4\u65b0\u539f\u538b\u7f29\u5305\u4e2d\u7684\u6587\u4ef6<\/p>\n<p>\u8fd9\u4e94\u4e2a\u662f\u72ec\u7acb\u7684\u547d\u4ee4\uff0c\u538b\u7f29\u89e3\u538b\u90fd\u8981\u7528\u5230\u5176\u4e2d\u4e00\u4e2a\uff0c\u53ef\u4ee5\u548c\u522b\u7684\u547d\u4ee4\u8fde\u7528\u4f46\u53ea\u80fd\u7528\u5176\u4e2d\u4e00\u4e2a\u3002\u4e0b\u9762\u7684\u53c2\u6570\u662f\u6839\u636e\u9700\u8981\u5728\u538b\u7f29\u6216\u89e3\u538b\u6863\u6848\u65f6\u53ef\u9009\u7684\u3002<\/p>\n<p>-z\uff1a\u6709gzip\u5c5e\u6027\u7684<br \/>\n-j\uff1a\u6709bz2\u5c5e\u6027\u7684<br \/>\n-Z\uff1a\u6709compress\u5c5e\u6027\u7684<br \/>\n-v\uff1a\u663e\u793a\u6240\u6709\u8fc7\u7a0b<br \/>\n-O\uff1a\u5c06\u6587\u4ef6\u89e3\u5f00\u5230\u6807\u51c6\u8f93\u51fa<\/p>\n<p>\u4e0b\u9762\u7684\u53c2\u6570-f\u662f\u5fc5\u987b\u7684<\/p>\n<p>-f: \u4f7f\u7528\u6863\u6848\u540d\u5b57\uff0c\u5207\u8bb0\uff0c\u8fd9\u4e2a\u53c2\u6570\u662f\u6700\u540e\u4e00\u4e2a\u53c2\u6570\uff0c\u540e\u9762\u53ea\u80fd\u63a5\u6863\u6848\u540d\u3002<\/p>\n<p>*tar -cf all.tar .jpg<br \/>\n\u8fd9\u6761\u547d\u4ee4\u662f\u5c06\u6240\u6709.jpg\u7684\u6587\u4ef6\u6253\u6210\u4e00\u4e2a\u540d\u4e3aall.tar\u7684\u5305\u3002-c\u662f\u8868\u793a\u4ea7\u751f\u65b0\u7684\u5305\uff0c-f\u6307\u5b9a\u5305\u7684\u6587\u4ef6\u540d\u3002<\/p>\n<p>*#tar -rf all.tar .gif<br \/>\n\u8fd9\u6761\u547d\u4ee4\u662f\u5c06\u6240\u6709.gif\u7684\u6587\u4ef6\u589e\u52a0\u5230all.tar\u7684\u5305\u91cc\u9762\u53bb\u3002-r\u662f\u8868\u793a\u589e\u52a0\u6587\u4ef6\u7684\u610f\u601d\u3002<\/p>\n<p># tar -uf all.tar logo.gif<br \/>\n\u8fd9\u6761\u547d\u4ee4\u662f\u66f4\u65b0\u539f\u6765tar\u5305all.tar\u4e2dlogo.gif\u6587\u4ef6\uff0c-u\u662f\u8868\u793a\u66f4\u65b0\u6587\u4ef6\u7684\u610f\u601d\u3002<\/p>\n<p># tar -tf all.tar<br \/>\n\u8fd9\u6761\u547d\u4ee4\u662f\u5217\u51faall.tar\u5305\u4e2d\u6240\u6709\u6587\u4ef6\uff0c-t\u662f\u5217\u51fa\u6587\u4ef6\u7684\u610f\u601d<\/p>\n<p>tar -xf all.tar<br \/>\n\u8fd9\u6761\u547d\u4ee4\u662f\u89e3\u51faall.tar\u5305\u4e2d\u6240\u6709\u6587\u4ef6\uff0c-x\u662f\u89e3\u5f00\u7684\u610f\u601d<\/p>\n<p>\u538b\u7f29<br \/>\ntar \u2013cvf jpg.tar *.jpg \/\/\u5c06\u76ee\u5f55\u91cc\u6240\u6709jpg\u6587\u4ef6\u6253\u5305\u6210tar.jpg<\/p>\n<p>tar \u2013czf jpg.tar.gz *.jpg \/\/\u5c06\u76ee\u5f55\u91cc\u6240\u6709jpg\u6587\u4ef6\u6253\u5305\u6210jpg.tar\u540e\uff0c\u5e76\u4e14\u5c06\u5176\u7528gzip\u538b\u7f29\uff0c\u751f\u6210\u4e00 \u4e2agzip\u538b\u7f29\u8fc7\u7684\u5305\uff0c\u547d\u540d\u4e3ajpg.tar.gz<\/p>\n<p>tar \u2013cjf jpg.tar.bz2 *.jpg \/\/\u5c06\u76ee\u5f55\u91cc\u6240\u6709jpg\u6587\u4ef6\u6253\u5305\u6210jpg.tar\u540e\uff0c\u5e76\u4e14\u5c06\u5176\u7528bzip2\u538b\u7f29\uff0c\u751f\u6210\u4e00\u4e2abzip2\u538b\u7f29\u8fc7\u7684\u5305\uff0c\u547d\u540d\u4e3ajpg.tar.bz2<\/p>\n<p>tar \u2013cZf jpg.tar.Z *.jpg \/\/\u5c06\u76ee\u5f55\u91cc\u6240\u6709jpg\u6587\u4ef6\u6253\u5305\u6210jpg.tar\u540e\uff0c\u5e76\u4e14\u5c06\u5176\u7528compress\u538b\u7f29\uff0c\u751f\u6210\u4e00\u4e2aumcompress\u538b\u7f29\u8fc7\u7684\u5305\uff0c\u547d\u540d\u4e3ajpg.tar.Z<\/p>\n<p>rar a jpg.rar *.jpg \/\/rar\u683c\u5f0f\u7684\u538b\u7f29\uff0c\u9700\u8981\u5148\u4e0b\u8f7drar for linux<\/p>\n<p>zip jpg.zip *.jpg \/\/zip\u683c\u5f0f\u7684\u538b\u7f29\uff0c\u9700\u8981\u5148\u4e0b\u8f7dzip for linux<\/p>\n<p>\u89e3\u538b<br \/>\ntar \u2013xvf file.tar \/\/\u89e3\u538b tar\u5305<\/p>\n<p>tar -xzvf file.tar.gz \/\/\u89e3\u538btar.gz<\/p>\n<p>tar -xjvf file.tar.bz2 \/\/\u89e3\u538b tar.bz2<\/p>\n<p>tar \u2013xZvf file.tar.Z \/\/\u89e3\u538btar.Z<\/p>\n<p>unrar e file.rar \/\/\u89e3\u538brar<\/p>\n<p>unzip file.zip \/\/\u89e3\u538bzip<\/p>\n<p>\u603b\u7ed3<br \/>\n(1)\u3001.tar \u7528 tar \u2013xvf \u89e3\u538b<br \/>\n(2)\u3001.gz \u7528 gzip -d\u6216\u8005gunzip \u89e3\u538b<br \/>\n(3)\u3001.tar.gz\u548c.tgz \u7528 tar \u2013xzf \u89e3\u538b<br \/>\n(4)\u3001.bz2 \u7528 bzip2 -d\u6216\u8005\u7528bunzip2 \u89e3\u538b<br \/>\n(5)\u3001.tar.bz2\u7528tar \u2013xjf \u89e3\u538b<br \/>\n(6)\u3001.Z \u7528 uncompress \u89e3\u538b<br \/>\n(7)\u3001.tar.Z \u7528tar \u2013xZf \u89e3\u538b<br \/>\n(8)\u3001.rar \u7528 unrar e\u89e3\u538b<br \/>\n(9)\u3001.zip \u7528 unzip \u89e3\u538b<\/p>\n<p>RPM \u5305 &#8211; \uff08Fedora, Redhat\u53ca\u7c7b\u4f3c\u7cfb\u7edf\uff09<br \/>\nrpm -ivh package.rpm \u5b89\u88c5\u4e00\u4e2arpm\u5305<br \/>\nrpm -ivh &#8211;nodeeps package.rpm \u5b89\u88c5\u4e00\u4e2arpm\u5305\u800c\u5ffd\u7565\u4f9d\u8d56\u5173\u7cfb\u8b66\u544a<br \/>\nrpm -U package.rpm \u66f4\u65b0\u4e00\u4e2arpm\u5305\u4f46\u4e0d\u6539\u53d8\u5176\u914d\u7f6e\u6587\u4ef6<br \/>\nrpm -F package.rpm \u66f4\u65b0\u4e00\u4e2a\u786e\u5b9a\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305<br \/>\nrpm -e package_name.rpm \u5220\u9664\u4e00\u4e2arpm\u5305<br \/>\nrpm -qa \u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305<br \/>\nrpm -qa | grep httpd \u663e\u793a\u6240\u6709\u540d\u79f0\u4e2d\u5305\u542b \u201chttpd\u201d \u5b57\u6837\u7684rpm\u5305<br \/>\nrpm -qi package_name \u83b7\u53d6\u4e00\u4e2a\u5df2\u5b89\u88c5\u5305\u7684\u7279\u6b8a\u4fe1\u606f<br \/>\nrpm -qg \u201cSystem Environment\/Daemons\u201d \u663e\u793a\u4e00\u4e2a\u7ec4\u4ef6\u7684rpm\u5305<br \/>\nrpm -ql package_name \u663e\u793a\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<br \/>\nrpm -qc package_name \u663e\u793a\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305\u63d0\u4f9b\u7684\u914d\u7f6e\u6587\u4ef6\u5217\u8868<br \/>\nrpm -q package_name &#8211;whatrequires \u663e\u793a\u4e0e\u4e00\u4e2arpm\u5305\u5b58\u5728\u4f9d\u8d56\u5173\u7cfb\u7684\u5217\u8868<br \/>\nrpm -q package_name &#8211;whatprovides \u663e\u793a\u4e00\u4e2arpm\u5305\u6240\u5360\u7684\u4f53\u79ef<br \/>\nrpm -q package_name &#8211;scripts \u663e\u793a\u5728\u5b89\u88c5\/\u5220\u9664\u671f\u95f4\u6240\u6267\u884c\u7684\u811a\u672cl<br \/>\nrpm -q package_name &#8211;changelog \u663e\u793a\u4e00\u4e2arpm\u5305\u7684\u4fee\u6539\u5386\u53f2<br \/>\nrpm -qf \/etc\/httpd\/conf\/httpd.conf \u786e\u8ba4\u6240\u7ed9\u7684\u6587\u4ef6\u7531\u54ea\u4e2arpm\u5305\u6240\u63d0\u4f9b<br \/>\nrpm -qp package.rpm -l \u663e\u793a\u7531\u4e00\u4e2a\u5c1a\u672a\u5b89\u88c5\u7684rpm\u5305\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<br \/>\nrpm &#8211;import \/media\/cdrom\/RPM-GPG-KEY \u5bfc\u5165\u516c\u94a5\u6570\u5b57\u8bc1\u4e66<br \/>\nrpm &#8211;checksig package.rpm \u786e\u8ba4\u4e00\u4e2arpm\u5305\u7684\u5b8c\u6574\u6027<br \/>\nrpm -qa gpg-pubkey \u786e\u8ba4\u5df2\u5b89\u88c5\u7684\u6240\u6709rpm\u5305\u7684\u5b8c\u6574\u6027<br \/>\nrpm -V package_name \u68c0\u67e5\u6587\u4ef6\u5c3a\u5bf8\u3001 \u8bb8\u53ef\u3001\u7c7b\u578b\u3001\u6240\u6709\u8005\u3001\u7fa4\u7ec4\u3001MD5\u68c0\u67e5\u4ee5\u53ca\u6700\u540e\u4fee\u6539\u65f6\u95f4<br \/>\nrpm -Va \u68c0\u67e5\u7cfb\u7edf\u4e2d\u6240\u6709\u5df2\u5b89\u88c5\u7684rpm\u5305- \u5c0f\u5fc3\u4f7f\u7528<br \/>\nrpm -Vp package.rpm \u786e\u8ba4\u4e00\u4e2arpm\u5305\u8fd8\u672a\u5b89\u88c5<br \/>\nrpm2cpio package.rpm | cpio &#8211;extract &#8211;make-directories bin \u4ece\u4e00\u4e2arpm\u5305\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6<br \/>\nrpm -ivh \/usr\/src\/redhat\/RPMS\/arch\/package.rpm \u4ece\u4e00\u4e2arpm\u6e90\u7801\u5b89\u88c5\u4e00\u4e2a\u6784\u5efa\u597d\u7684\u5305<br \/>\nrpmbuild &#8211;rebuild package_name.src.rpm \u4ece\u4e00\u4e2arpm\u6e90\u7801\u6784\u5efa\u4e00\u4e2a rpm \u5305<\/p>\n<p>YUM \u8f6f\u4ef6\u5305\u5347\u7ea7\u5668 &#8211; \uff08Fedora, RedHat\u53ca\u7c7b\u4f3c\u7cfb\u7edf\uff09<br \/>\nyum install package_name \u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e00\u4e2arpm\u5305<br \/>\nyum localinstall package_name.rpm \u5c06\u5b89\u88c5\u4e00\u4e2arpm\u5305\uff0c\u4f7f\u7528\u4f60\u81ea\u5df1\u7684\u8f6f\u4ef6\u4ed3\u5e93\u4e3a\u4f60\u89e3\u51b3\u6240\u6709\u4f9d\u8d56\u5173\u7cfb<br \/>\nyum update package_name.rpm \u66f4\u65b0\u5f53\u524d\u7cfb\u7edf\u4e2d\u6240\u6709\u5b89\u88c5\u7684rpm\u5305<br \/>\nyum update package_name \u66f4\u65b0\u4e00\u4e2arpm\u5305<br \/>\nyum remove package_name \u5220\u9664\u4e00\u4e2arpm\u5305<br \/>\nyum list \u5217\u51fa\u5f53\u524d\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684\u6240\u6709\u5305<br \/>\nyum search package_name \u5728rpm\u4ed3\u5e93\u4e2d\u641c\u5bfb\u8f6f\u4ef6\u5305<br \/>\nyum clean packages \u6e05\u7406rpm\u7f13\u5b58\u5220\u9664\u4e0b\u8f7d\u7684\u5305<br \/>\nyum clean headers \u5220\u9664\u6240\u6709\u5934\u6587\u4ef6<br \/>\nyum clean all \u5220\u9664\u6240\u6709\u7f13\u5b58\u7684\u5305\u548c\u5934\u6587\u4ef6<\/p>\n<p>DEB \u5305 (Debian, Ubuntu \u4ee5\u53ca\u7c7b\u4f3c\u7cfb\u7edf)<br \/>\ndpkg -i package.deb \u5b89\u88c5\/\u66f4\u65b0\u4e00\u4e2a deb \u5305<br \/>\ndpkg -r package_name \u4ece\u7cfb\u7edf\u5220\u9664\u4e00\u4e2a deb \u5305<br \/>\ndpkg -l \u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u5df2\u7ecf\u5b89\u88c5\u7684 deb \u5305<br \/>\ndpkg -l | grep httpd \u663e\u793a\u6240\u6709\u540d\u79f0\u4e2d\u5305\u542b \u201chttpd\u201d \u5b57\u6837\u7684deb\u5305<br \/>\ndpkg -s package_name \u83b7\u5f97\u5df2\u7ecf\u5b89\u88c5\u5728\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u7279\u6b8a\u5305\u7684\u4fe1\u606f<br \/>\ndpkg -L package_name \u663e\u793a\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u7684\u4e00\u4e2adeb\u5305\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<br \/>\ndpkg &#8211;contents package.deb \u663e\u793a\u5c1a\u672a\u5b89\u88c5\u7684\u4e00\u4e2a\u5305\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<br \/>\ndpkg -S \/bin\/ping \u786e\u8ba4\u6240\u7ed9\u7684\u6587\u4ef6\u7531\u54ea\u4e2adeb\u5305\u63d0\u4f9b<\/p>\n<p>APT \u8f6f\u4ef6\u5de5\u5177 (Debian, Ubuntu \u4ee5\u53ca\u7c7b\u4f3c\u7cfb\u7edf)<br \/>\napt-get install package_name \u5b89\u88c5\/\u66f4\u65b0\u4e00\u4e2a deb \u5305<br \/>\napt-cdrom install package_name \u4ece\u5149\u76d8\u5b89\u88c5\/\u66f4\u65b0\u4e00\u4e2a deb \u5305<br \/>\napt-get update \u5347\u7ea7\u5217\u8868\u4e2d\u7684\u8f6f\u4ef6\u5305<br \/>\napt-get upgrade \u5347\u7ea7\u6240\u6709\u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6<br \/>\napt-get remove package_name \u4ece\u7cfb\u7edf\u5220\u9664\u4e00\u4e2adeb\u5305<br \/>\napt-get check \u786e\u8ba4\u4f9d\u8d56\u7684\u8f6f\u4ef6\u4ed3\u5e93\u6b63\u786e<br \/>\napt-get clean \u4ece\u4e0b\u8f7d\u7684\u8f6f\u4ef6\u5305\u4e2d\u6e05\u7406\u7f13\u5b58<br \/>\napt-cache search searched-package \u8fd4\u56de\u5305\u542b\u6240\u8981\u641c\u7d22\u5b57\u7b26\u4e32\u7684\u8f6f\u4ef6\u5305\u540d\u79f0<\/p>\n<p>\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<br \/>\ncat file1 \u4ece\u7b2c\u4e00\u4e2a\u5b57\u8282\u5f00\u59cb\u6b63\u5411\u67e5\u770b\u6587\u4ef6\u7684\u5185\u5bb9<br \/>\ntac file1 \u4ece\u6700\u540e\u4e00\u884c\u5f00\u59cb\u53cd\u5411\u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9<br \/>\nmore file1 \u67e5\u770b\u4e00\u4e2a\u957f\u6587\u4ef6\u7684\u5185\u5bb9<br \/>\nless file1 \u7c7b\u4f3c\u4e8e \u2018more\u2019 \u547d\u4ee4\uff0c\u4f46\u662f\u5b83\u5141\u8bb8\u5728\u6587\u4ef6\u4e2d\u548c\u6b63\u5411\u64cd\u4f5c\u4e00\u6837\u7684\u53cd\u5411\u64cd\u4f5c<br \/>\nhead -2 file1 \u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u524d\u4e24\u884c<br \/>\ntail -2 file1 \u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u6700\u540e\u4e24\u884c<br \/>\ntail -f \/var\/log\/messages \u5b9e\u65f6\u67e5\u770b\u88ab\u6dfb\u52a0\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/p>\n<p>\u6587\u672c\u5904\u7406<br \/>\ncat file1 file2 \u2026 | command &lt;&gt; file1_in.txt_or_file1_out.txt general syntax for text manipulation using PIPE, STDIN and STDOUT<br \/>\ncat file1 | command( sed, grep, awk, grep, etc\u2026) &gt; result.txt \u5408\u5e76\u4e00\u4e2a\u6587\u4ef6\u7684\u8be6\u7ec6\u8bf4\u660e\u6587\u672c\uff0c\u5e76\u5c06\u7b80\u4ecb\u5199\u5165\u4e00\u4e2a\u65b0\u6587\u4ef6\u4e2d<br \/>\ncat file1 | command( sed, grep, awk, grep, etc\u2026) &gt;&gt; result.txt \u5408\u5e76\u4e00\u4e2a\u6587\u4ef6\u7684\u8be6\u7ec6\u8bf4\u660e\u6587\u672c\uff0c\u5e76\u5c06\u7b80\u4ecb\u5199\u5165\u4e00\u4e2a\u5df2\u6709\u7684\u6587\u4ef6\u4e2d<br \/>\ngrep Aug \/var\/log\/messages \u5728\u6587\u4ef6 &#8216;\/var\/log\/messages\u2019\u4e2d\u67e5\u627e\u5173\u952e\u8bcd&#8221;Aug&#8221;<br \/>\ngrep ^Aug \/var\/log\/messages \u5728\u6587\u4ef6 &#8216;\/var\/log\/messages\u2019\u4e2d\u67e5\u627e\u4ee5&#8221;Aug&#8221;\u5f00\u59cb\u7684\u8bcd\u6c47<br \/>\ngrep [0-9] \/var\/log\/messages \u9009\u62e9 \u2018\/var\/log\/messages\u2019 \u6587\u4ef6\u4e2d\u6240\u6709\u5305\u542b\u6570\u5b57\u7684\u884c<br \/>\ngrep Aug -R \/var\/log\/* \u5728\u76ee\u5f55 \u2018\/var\/log\u2019 \u53ca\u968f\u540e\u7684\u76ee\u5f55\u4e2d\u641c\u7d22\u5b57\u7b26\u4e32&#8221;Aug&#8221;<br \/>\nsed \u2018s\/stringa1\/stringa2\/g\u2019 example.txt \u5c06example.txt\u6587\u4ef6\u4e2d\u7684 \u201cstring1\u201d \u66ff\u6362\u6210 \u201cstring2\u201d<br \/>\nsed \u2018\/^KaTeX parse error: Expected &#8216;EOF&#8217;, got &#8216;#&#8217; at position 49: \u2026\u6240\u6709\u7a7a\u767d\u884c sed &#8216;\/ *#\u0332\/d; \/^\/d\u2019 example.txt \u4eceexample.txt\u6587\u4ef6\u4e2d\u5220\u9664\u6240\u6709\u6ce8\u91ca\u548c\u7a7a\u767d\u884c<br \/>\necho \u2018esempio\u2019 | tr \u2018[:lower:]\u2019 \u2018[:upper:]\u2019 \u5408\u5e76\u4e0a\u4e0b\u5355\u5143\u683c\u5185\u5bb9<br \/>\nsed -e \u20181d\u2019 result.txt \u4ece\u6587\u4ef6example.txt \u4e2d\u6392\u9664\u7b2c\u4e00\u884c<br \/>\nsed -n \u2018\/stringa1\/p\u2019 \u67e5\u770b\u53ea\u5305\u542b\u8bcd\u6c47 \u201cstring1&#8243;\u7684\u884c<br \/>\nsed -e \u2018s\/ $\/\/\u2019 example.txt \u5220\u9664\u6bcf\u4e00\u884c\u6700\u540e\u7684\u7a7a\u767d\u5b57\u7b26<br \/>\nsed -e \u2018s\/stringa1\/\/g\u2019 example.txt \u4ece\u6587\u6863\u4e2d\u53ea\u5220\u9664\u8bcd\u6c47 \u201cstring1\u201d \u5e76\u4fdd\u7559\u5269\u4f59\u5168\u90e8<br \/>\nsed -n \u20181,5p;5q\u2019 example.txt \u67e5\u770b\u4ece\u7b2c\u4e00\u884c\u5230\u7b2c5\u884c\u5185\u5bb9<br \/>\nsed -n \u20185p;5q\u2019 example.txt \u67e5\u770b\u7b2c5\u884c<br \/>\nsed -e &#8216;s\/00\/0\/g\u2019 example.txt \u7528\u5355\u4e2a\u96f6\u66ff\u6362\u591a\u4e2a\u96f6<br \/>\ncat -n file1 \u6807\u793a\u6587\u4ef6\u7684\u884c\u6570<br \/>\ncat example.txt | awk \u2018NR%2==1\u2019 \u5220\u9664example.txt\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5076\u6570\u884c<br \/>\necho a b c | awk \u2018{print $1}\u2019 \u67e5\u770b\u4e00\u884c\u7b2c\u4e00\u680f<br \/>\necho a b c | awk \u2018{print $1,$3}\u2019 \u67e5\u770b\u4e00\u884c\u7684\u7b2c\u4e00\u548c\u7b2c\u4e09\u680f<br \/>\npaste file1 file2 \u5408\u5e76\u4e24\u4e2a\u6587\u4ef6\u6216\u4e24\u680f\u7684\u5185\u5bb9<br \/>\npaste -d \u2018+\u2019 file1 file2 \u5408\u5e76\u4e24\u4e2a\u6587\u4ef6\u6216\u4e24\u680f\u7684\u5185\u5bb9\uff0c\u4e2d\u95f4\u7528\u201d+&#8221;\u533a\u5206<br \/>\nsort file1 file2 \u6392\u5e8f\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9<br \/>\nsort file1 file2 | uniq \u53d6\u51fa\u4e24\u4e2a\u6587\u4ef6\u7684\u5e76\u96c6(\u91cd\u590d\u7684\u884c\u53ea\u4fdd\u7559\u4e00\u4efd)<br \/>\nsort file1 file2 | uniq -u \u5220\u9664\u4ea4\u96c6\uff0c\u7559\u4e0b\u5176\u4ed6\u7684\u884c<br \/>\nsort file1 file2 | uniq -d \u53d6\u51fa\u4e24\u4e2a\u6587\u4ef6\u7684\u4ea4\u96c6(\u53ea\u7559\u4e0b\u540c\u65f6\u5b58\u5728\u4e8e\u4e24\u4e2a\u6587\u4ef6\u4e2d\u7684\u6587\u4ef6)<br \/>\ncomm -1 file1 file2 \u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u53ea\u5220\u9664 \u2018file1\u2019 \u6240\u5305\u542b\u7684\u5185\u5bb9<br \/>\ncomm -2 file1 file2 \u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u53ea\u5220\u9664 \u2018file2\u2019 \u6240\u5305\u542b\u7684\u5185\u5bb9<br \/>\ncomm -3 file1 file2 \u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u53ea\u5220\u9664\u4e24\u4e2a\u6587\u4ef6\u5171\u6709\u7684\u90e8\u5206<\/p>\n<p>\u5b57\u7b26\u8bbe\u7f6e\u548c\u6587\u4ef6\u683c\u5f0f\u8f6c\u6362<br \/>\ndos2unix filedos.txt fileunix.txt \u5c06\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u683c\u5f0f\u4eceMSDOS\u8f6c\u6362\u6210UNIX<br \/>\nunix2dos fileunix.txt filedos.txt \u5c06\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u683c\u5f0f\u4eceUNIX\u8f6c\u6362\u6210MSDOS<br \/>\nrecode \u2026HTML &lt; page.txt &gt; page.html \u5c06\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u8f6c\u6362\u6210html<br \/>\nrecode -l | more \u663e\u793a\u6240\u6709\u5141\u8bb8\u7684\u8f6c\u6362\u683c\u5f0f<\/p>\n<p>\u6587\u4ef6\u7cfb\u7edf\u5206\u6790<br \/>\nbadblocks -v \/dev\/hda1 \u68c0\u67e5\u78c1\u76d8hda1\u4e0a\u7684\u574f\u78c1\u5757<br \/>\nfsck \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0alinux\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\nfsck.ext2 \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext2\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\ne2fsck \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext2\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\ne2fsck -j \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext3\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\nfsck.ext3 \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext3\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\nfsck.vfat \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0afat\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\nfsck.msdos \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0ados\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<br \/>\ndosfsck \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0ados\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/p>\n<p>\u521d\u59cb\u5316\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf<br \/>\nmkfs \/dev\/hda1 \u5728hda1\u5206\u533a\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf<br \/>\nmke2fs \/dev\/hda1 \u5728hda1\u5206\u533a\u521b\u5efa\u4e00\u4e2alinux ext2\u7684\u6587\u4ef6\u7cfb\u7edf<br \/>\nmke2fs -j \/dev\/hda1 \u5728hda1\u5206\u533a\u521b\u5efa\u4e00\u4e2alinux ext3(\u65e5\u5fd7\u578b)\u7684\u6587\u4ef6\u7cfb\u7edf<br \/>\nmkfs -t vfat 32 -F \/dev\/hda1 \u521b\u5efa\u4e00\u4e2a FAT32 \u6587\u4ef6\u7cfb\u7edf<br \/>\nfdformat -n \/dev\/fd0 \u683c\u5f0f\u5316\u4e00\u4e2a\u8f6f\u76d8<br \/>\nmkswap \/dev\/hda3 \u521b\u5efa\u4e00\u4e2aswap\u6587\u4ef6\u7cfb\u7edf<\/p>\n<p>\u78c1\u76d8\u914d\u989d<br \/>\n[root@localhost \/]# quotacheck -avug<br \/>\n\u8f93\u5165quotaon -avgu\uff1a\u542f\u52a8\u78c1\u76d8\u914d\u989d<br \/>\n[root@localhost test]# edquota -u quota1 &#8211;&gt;\u4fee\u6539\u9488\u5bf9quota1\u7528\u6237\u7684\u914d\u7f6e<br \/>\n[root@localhost test]# edquota -g myquota &#8211;&gt;\u4fee\u6539\u9488\u5bf9myquota\u7ec4\u7684\u914d\u7f6e<\/p>\n<p>SWAP\u6587\u4ef6\u7cfb\u7edf<br \/>\nmkswap \/dev\/hda3 \u521b\u5efa\u4e00\u4e2aswap\u6587\u4ef6\u7cfb\u7edf<br \/>\nswapon \/dev\/hda3 \u542f\u7528\u4e00\u4e2a\u65b0\u7684swap\u6587\u4ef6\u7cfb\u7edf<br \/>\nswapon \/dev\/hda2 \/dev\/hdb3 \u542f\u7528\u4e24\u4e2aswap\u5206\u533a<\/p>\n<p>\u5907\u4efd<br \/>\ndump -0aj -f \/tmp\/home0.bak \/home \u5236\u4f5c\u4e00\u4e2a \u2018\/home\u2019 \u76ee\u5f55\u7684\u5b8c\u6574\u5907\u4efd<br \/>\ndump -1aj -f \/tmp\/home0.bak \/home \u5236\u4f5c\u4e00\u4e2a \u2018\/home\u2019 \u76ee\u5f55\u7684\u4ea4\u4e92\u5f0f\u5907\u4efd<br \/>\nrestore -if \/tmp\/home0.bak \u8fd8\u539f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u5907\u4efd<br \/>\nrsync -rogpav &#8211;delete \/home \/tmp \u540c\u6b65\u4e24\u8fb9\u7684\u76ee\u5f55<br \/>\nrsync -rogpav -e ssh &#8211;delete \/home ip_address:\/tmp \u901a\u8fc7SSH\u901a\u9053rsync<br \/>\nrsync -az -e ssh &#8211;delete ip_addr:\/home\/public \/home\/local \u901a\u8fc7ssh\u548c\u538b\u7f29\u5c06\u4e00\u4e2a\u8fdc\u7a0b\u76ee\u5f55\u540c\u6b65\u5230\u672c\u5730\u76ee\u5f55<br \/>\nrsync -az -e ssh &#8211;delete \/home\/local ip_addr:\/home\/public \u901a\u8fc7ssh\u548c\u538b\u7f29\u5c06\u672c\u5730\u76ee\u5f55\u540c\u6b65\u5230\u8fdc\u7a0b\u76ee\u5f55<br \/>\ndd bs=1M if=\/dev\/hda | gzip | ssh user@ip_addr \u2018dd of=hda.gz\u2019 \u901a\u8fc7ssh\u5728\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u6267\u884c\u4e00\u6b21\u5907\u4efd\u672c\u5730\u78c1\u76d8\u7684\u64cd\u4f5c<br \/>\ndd if=\/dev\/sda of=\/tmp\/file1 \u5907\u4efd\u78c1\u76d8\u5185\u5bb9\u5230\u4e00\u4e2a\u6587\u4ef6<br \/>\ntar -Puf backup.tar \/home\/user \u6267\u884c\u4e00\u6b21\u5bf9 \u2018\/home\/user\u2019 \u76ee\u5f55\u7684\u4ea4\u4e92\u5f0f\u5907\u4efd\u64cd\u4f5c<br \/>\n( cd \/tmp\/local\/ &amp;&amp; tar c . ) | ssh -C user@ip_addr \u2018cd \/home\/share\/ &amp;&amp; tar x -p\u2019 \u901a\u8fc7ssh\u5728\u8fdc\u7a0b\u76ee\u5f55\u4e2d\u590d\u5236\u4e00\u4e2a\u76ee\u5f55\u5185\u5bb9<br \/>\n( tar c \/home ) | ssh -C user@ip_addr \u2018cd \/home\/backup-home &amp;&amp; tar x -p\u2019 \u901a\u8fc7ssh\u5728\u8fdc\u7a0b\u76ee\u5f55\u4e2d\u590d\u5236\u4e00\u4e2a\u672c\u5730\u76ee\u5f55<br \/>\ntar cf &#8211; . | (cd \/tmp\/backup ; tar xf &#8211; ) \u672c\u5730\u5c06\u4e00\u4e2a\u76ee\u5f55\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u5730\u65b9\uff0c\u4fdd\u7559\u539f\u6709\u6743\u9650\u53ca\u94fe\u63a5<br \/>\nfind \/home\/user1 -name \u2018.txt\u2019 | xargs cp -av &#8211;target-directory=\/home\/backup\/ &#8211;parents \u4ece\u4e00\u4e2a\u76ee\u5f55\u67e5\u627e\u5e76\u590d\u5236\u6240\u6709\u4ee5 \u2018.txt\u2019 \u7ed3\u5c3e\u7684\u6587\u4ef6\u5230\u53e6\u4e00\u4e2a\u76ee\u5f55<br \/>\nfind \/var\/log -name &#8216;.log\u2019 | tar cv &#8211;files-from=- | bzip2 &gt; log.tar.bz2 \u67e5\u627e\u6240\u6709\u4ee5 \u2018.log\u2019 \u7ed3\u5c3e\u7684\u6587\u4ef6\u5e76\u505a\u6210\u4e00\u4e2abzip\u5305<br \/>\ndd if=\/dev\/hda of=\/dev\/fd0 bs=512 count=1 \u505a\u4e00\u4e2a\u5c06 MBR (Master Boot Record)\u5185\u5bb9\u590d\u5236\u5230\u8f6f\u76d8\u7684\u52a8\u4f5c<br \/>\ndd if=\/dev\/fd0 of=\/dev\/hda bs=512 count=1 \u4ece\u5df2\u7ecf\u4fdd\u5b58\u5230\u8f6f\u76d8\u7684\u5907\u4efd\u4e2d\u6062\u590dMBR\u5185\u5bb9<\/p>\n<p>\u5149\u76d8<br \/>\ncdrecord -v gracetime=2 dev=\/dev\/cdrom -eject blank=fast -force \u6e05\u7a7a\u4e00\u4e2a\u53ef\u590d\u5199\u7684\u5149\u76d8\u5185\u5bb9<br \/>\nmkisofs \/dev\/cdrom &gt; cd.iso \u5728\u78c1\u76d8\u4e0a\u521b\u5efa\u4e00\u4e2a\u5149\u76d8\u7684iso\u955c\u50cf\u6587\u4ef6<br \/>\nmkisofs \/dev\/cdrom | gzip &gt; cd_iso.gz \u5728\u78c1\u76d8\u4e0a\u521b\u5efa\u4e00\u4e2a\u538b\u7f29\u4e86\u7684\u5149\u76d8iso\u955c\u50cf\u6587\u4ef6<br \/>\nmkisofs -J -allow-leading-dots -R -V \u201cLabel CD\u201d -iso-level 4 -o .\/cd.iso data_cd \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u7684iso\u955c\u50cf\u6587\u4ef6<br \/>\ncdrecord -v dev=\/dev\/cdrom cd.iso \u523b\u5f55\u4e00\u4e2aISO\u955c\u50cf\u6587\u4ef6<br \/>\ngzip -dc cd_iso.gz | cdrecord dev=\/dev\/cdrom &#8211; \u523b\u5f55\u4e00\u4e2a\u538b\u7f29\u4e86\u7684ISO\u955c\u50cf\u6587\u4ef6<br \/>\nmount -o loop cd.iso \/mnt\/iso \u6302\u8f7d\u4e00\u4e2aISO\u955c\u50cf\u6587\u4ef6<br \/>\ncd-paranoia -B \u4ece\u4e00\u4e2aCD\u5149\u76d8\u8f6c\u5f55\u97f3\u8f68\u5230 wav \u6587\u4ef6\u4e2d<br \/>\ncd-paranoia \u2013 \u201c-3\u201d \u4ece\u4e00\u4e2aCD\u5149\u76d8\u8f6c\u5f55\u97f3\u8f68\u5230 wav \u6587\u4ef6\u4e2d\uff08\u53c2\u6570-3\uff09<br \/>\ncdrecord &#8211;scanbus \u626b\u63cf\u603b\u7ebf\u4ee5\u8bc6\u522bscsi\u901a\u9053<br \/>\ndd if=\/dev\/hdc | md5sum \u6821\u9a8c\u4e00\u4e2a\u8bbe\u5907\u7684md5sum\u7f16\u7801\uff0c\u4f8b\u5982\u4e00\u5f20 CD<\/p>\n<p>\u7f51\u7edc &#8211; \uff08\u4ee5\u592a\u7f51\u548cWIFI\u65e0\u7ebf\uff09<br \/>\nifconfig eth0 \u663e\u793a\u4e00\u4e2a\u4ee5\u592a\u7f51\u5361\u7684\u914d\u7f6e<br \/>\nifup eth0 \u542f\u7528\u4e00\u4e2a \u2018eth0\u2019 \u7f51\u7edc\u8bbe\u5907<br \/>\nifdown eth0 \u7981\u7528\u4e00\u4e2a \u2018eth0\u2019 \u7f51\u7edc\u8bbe\u5907<br \/>\nifconfig eth0 192.168.1.1 netmask 255.255.255.0 \u63a7\u5236IP\u5730\u5740<br \/>\nifconfig eth0 promisc \u8bbe\u7f6e \u2018eth0\u2019 \u6210\u6df7\u6742\u6a21\u5f0f\u4ee5\u55c5\u63a2\u6570\u636e\u5305 (sniffing)<br \/>\ndhclient eth0 \u4ee5dhcp\u6a21\u5f0f\u542f\u7528 \u2018eth0\u2019<br \/>\nroute -n show routing table<br \/>\nroute add -net 0\/0 gw IP_Gateway configura default gateway<br \/>\nroute add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 configure static route to reach network \u2018192.168.0.0\/16\u2019<br \/>\nroute del 0\/0 gw IP_gateway remove static route<br \/>\necho \u201c1\u201d &gt; \/proc\/sys\/net\/ipv4\/ip_forward activate ip routing<br \/>\nhostname show hostname of system<br \/>\nhost www.example.com lookup hostname to resolve name to ip address and viceversa(1)<br \/>\nnslookup www.example.com lookup hostname to resolve name to ip address and viceversa(2)<br \/>\nip link show show link status of all interfaces<br \/>\nmii-tool eth0 show link status of \u2018eth0\u2019<br \/>\nethtool eth0 show statistics of network card \u2018eth0\u2019<br \/>\nnetstat -tup show all active network connections and their PID<br \/>\nnetstat -tupl show all network services listening on the system and their PID<br \/>\ntcpdump tcp port 80 show all HTTP traffic<br \/>\niwlist scan show wireless networks<br \/>\niwconfig eth1 show configuration of a wireless network card<br \/>\nhostname show hostname<br \/>\nhost www.example.com lookup hostname to resolve name to ip address and viceversa<br \/>\nnslookup www.example.com lookup hostname to resolve name to ip address and viceversa<br \/>\nwhois www.example.com lookup on Whois database<\/p>\n<p>JPS\u5de5\u5177<br \/>\njps(Java Virtual Machine Process Status Tool)\u662fJDK 1.5\u63d0\u4f9b\u7684\u4e00\u4e2a\u663e\u793a\u5f53\u524d\u6240\u6709java\u8fdb\u7a0bpid\u7684\u547d\u4ee4\uff0c\u7b80\u5355\u5b9e\u7528\uff0c\u975e\u5e38\u9002\u5408\u5728linux\/unix\u5e73\u53f0\u4e0a\u7b80\u5355\u5bdf\u770b\u5f53\u524djava\u8fdb\u7a0b\u7684\u4e00\u4e9b\u7b80\u5355\u60c5\u51b5\u3002<\/p>\n<p>\u6211\u60f3\u5f88\u591a\u4eba\u90fd\u662f\u7528\u8fc7unix\u7cfb\u7edf\u91cc\u7684ps\u547d\u4ee4\uff0c\u8fd9\u4e2a\u547d\u4ee4\u4e3b\u8981\u662f\u7528\u6765\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u7684\u8fdb\u7a0b\u60c5\u51b5\uff0c\u6709\u54ea\u4e9b\u8fdb\u7a0b\uff0c\u53ca\u5176 id\u3002 jps \u4e5f\u662f\u4e00\u6837\uff0c\u5b83\u7684\u4f5c\u7528\u662f\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u7684java\u8fdb\u7a0b\u60c5\u51b5\uff0c\u53ca\u5176id\u53f7\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5b83\u6765\u67e5\u770b\u6211\u4eec\u5230\u5e95\u542f\u52a8\u4e86\u51e0\u4e2ajava\u8fdb\u7a0b\uff08\u56e0\u4e3a\u6bcf\u4e00\u4e2ajava\u7a0b\u5e8f\u90fd\u4f1a\u72ec\u5360\u4e00\u4e2ajava\u865a\u62df\u673a\u5b9e\u4f8b\uff09\uff0c\u548c\u4ed6\u4eec\u7684\u8fdb\u7a0b\u53f7\uff08\u4e3a\u4e0b\u9762\u51e0\u4e2a\u7a0b\u5e8f\u505a\u51c6\u5907\uff09\uff0c\u5e76\u53ef\u901a\u8fc7opt\u6765\u67e5\u770b\u8fd9\u4e9b\u8fdb\u7a0b\u7684\u8be6\u7ec6\u542f\u52a8\u53c2\u6570\u3002<\/p>\n<p>\u4f7f\u7528\u65b9\u6cd5\uff1a\u5728\u5f53\u524d\u547d\u4ee4\u884c\u4e0b\u6253 jps(\u9700\u8981JAVA_HOME\uff0c\u6ca1\u6709\u7684\u8bdd\uff0c\u5230\u6539\u7a0b\u5e8f\u7684\u76ee\u5f55\u4e0b\u6253) \u3002<\/p>\n<p>jps\u5b58\u653e\u5728JAVA_HOME\/bin\/jps\uff0c\u4f7f\u7528\u65f6\u4e3a\u4e86\u65b9\u4fbf\u8bf7\u5c06JAVA_HOME\/bin\/\u52a0\u5165\u5230Path.<\/p>\n<p>$&gt; jps<br \/>\n23991 Jps<br \/>\n23789 BossMain<br \/>\n23651 Resin<\/p>\n<p>\u6bd4\u8f83\u5e38\u7528\u7684\u53c2\u6570\uff1a<\/p>\n<p>-q \u53ea\u663e\u793apid\uff0c\u4e0d\u663e\u793aclass\u540d\u79f0,jar\u6587\u4ef6\u540d\u548c\u4f20\u9012\u7ed9main \u65b9\u6cd5\u7684\u53c2\u6570<br \/>\n$&gt; jps -q<br \/>\n28680<br \/>\n23789<br \/>\n23651<\/p>\n<p>-m \u8f93\u51fa\u4f20\u9012\u7ed9main \u65b9\u6cd5\u7684\u53c2\u6570\uff0c\u5728\u5d4c\u5165\u5f0fjvm\u4e0a\u53ef\u80fd\u662fnull<\/p>\n<p>$&gt; jps -m<br \/>\n28715 Jps -m<br \/>\n23789 BossMain<br \/>\n23651 Resin -socketwait 32768 -stdout \/data\/aoxj\/resin\/log\/stdout.log -stderr \/data\/aoxj\/resin\/log\/stderr.log<\/p>\n<p>-l \u8f93\u51fa\u5e94\u7528\u7a0b\u5e8fmain class\u7684\u5b8c\u6574package\u540d \u6216\u8005 \u5e94\u7528\u7a0b\u5e8f\u7684jar\u6587\u4ef6\u5b8c\u6574\u8def\u5f84\u540d<\/p>\n<p>$&gt; jps -l<br \/>\n28729 sun.tools.jps.Jps<br \/>\n23789 com.asiainfo.aimc.bossbi.BossMain<br \/>\n23651 com.caucho.server.resin.Resin<\/p>\n<p>-v \u8f93\u51fa\u4f20\u9012\u7ed9JVM\u7684\u53c2\u6570<\/p>\n<p>$&gt; jps -v<br \/>\n23789 BossMain<br \/>\n28802 Jps -Denv.class.path=\/data\/aoxj\/bossbi\/twsecurity\/java\/trustwork140.jar:\/data\/aoxj\/bossbi\/twsecurity\/java\/:\/data\/aoxj\/bossbi\/twsecurity\/java\/twcmcc.jar:\/data\/aoxj\/jdk15\/lib\/rt.jar:\/data\/aoxj\/jd<\/p>\n<p>k15\/lib\/tools.jar -Dapplication.home=\/data\/aoxj\/jdk15 -Xms8m<br \/>\n23651 Resin -Xss1m -Dresin.home=\/data\/aoxj\/resin -Dserver.root=\/data\/aoxj\/resin -Djava.util.logging.manager=com.caucho.log.LogManagerImpl &#8211;<\/p>\n<p>Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl<\/p>\n<p>sudo jps\u770b\u5230\u7684\u8fdb\u7a0b\u6570\u91cf\u6700\u5168<\/p>\n<p>jps 192.168.0.77<\/p>\n<p>\u5217\u51fa\u8fdc\u7a0b\u670d\u52a1\u5668192.168.0.77\u673a\u5668\u6240\u6709\u7684jvm\u5b9e\u4f8b\uff0c\u91c7\u7528rmi\u534f\u8bae\uff0c\u9ed8\u8ba4\u8fde\u63a5\u7aef\u53e3\u4e3a1099<\/p>\n<p>\uff08\u524d\u63d0\u662f\u8fdc\u7a0b\u670d\u52a1\u5668\u63d0\u4f9bjstatd\u670d\u52a1\uff09<\/p>\n<p>\u6ce8\uff1ajps\u547d\u4ee4\u6709\u4e2a\u5730\u65b9\u5f88\u4e0d\u597d\uff0c\u4f3c\u4e4e\u53ea\u80fd\u663e\u793a\u5f53\u524d\u7528\u6237\u7684java\u8fdb\u7a0b\uff0c\u8981\u663e\u793a\u5176\u4ed6\u7528\u6237\u7684\u8fd8\u662f\u53ea\u80fd\u7528unix\/linux\u7684ps\u547d\u4ee4\u3002<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faa CC 4.0 BY-SA \u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u548c\u672c\u58f0\u660e\u3002<\/p>\n<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/Number_oneEngineer\/article\/details\/83215694<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u90fd\u5728\u548cLinux\u6253\u4ea4\u9053\uff0c\u611f\u89c9\u8fd8\u4e0d\u9519\u3002\u6211\u89c9\u5f97Linux\u76f8\u6bd4windows\u6bd4\u8f83\u9ebb\u70e6\u7684\u5c31\u662f\u5f88\u591a\u4e1c\u897f\u90fd\u8981\u7528\u547d\u4ee4\u6765\u63a7\u5236\uff0c\u5f53\u7136\uff0c\u8fd9\u4e5f\u662f\u5f88\u591a\u4eba\u559c\u6b22linux\u7684\u539f\u56e0\uff0c\u6bd4\u8f83\u77ed\u5c0f\u4f46\u5374\u529f\u80fd\u5f3a\u5927\u3002\u6211\u5c06\u6211\u4e86\u89e3\u5230\u7684\u547d\u4ee4\u5217\u4e3e\u4e00\u4e0b\uff0c\u4ec5\u4f9b\u5927\u5bb6\u53c2\u8003\uff1a \u7cfb\u7edf\u4fe1\u606f arch \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784(1) uname -m \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784(2) uname -r \u663e\u793a\u6b63\u5728\u4f7f\u7528\u7684\u5185\u6838\u7248\u672c dmidecode -q \u663e\u793a\u786c\u4ef6\u7cfb\u7edf\u90e8\u4ef6 &#8211; (SMBIOS \/ DMI) hdparm -i \/dev\/hda \u7f57\u5217\u4e00\u4e2a\u78c1\u76d8\u7684\u67b6\u6784\u7279\u6027 hdparm -tT \/dev\/sda \u5728\u78c1\u76d8\u4e0a\u6267\u884c\u6d4b\u8bd5\u6027\u8bfb\u53d6\u64cd\u4f5c cat \/proc\/cpuinfo \u663e\u793aCPU info\u7684\u4fe1\u606f cat \/proc\/interrupts \u663e\u793a\u4e2d\u65ad cat \/proc\/meminfo \u6821\u9a8c\u5185\u5b58\u4f7f\u7528 cat \/proc\/swaps \u663e\u793a\u54ea\u4e9bswap\u88ab\u4f7f\u7528 cat \/proc\/version \u663e\u793a\u5185\u6838\u7684\u7248\u672c cat \/proc\/net\/dev \u663e\u793a\u7f51\u7edc\u9002\u914d\u5668\u53ca\u7edf\u8ba1 cat \/proc\/mounts \u663e\u793a\u5df2\u52a0\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf lspci -tv \u7f57\u5217 PCI \u8bbe\u5907 lsusb -tv \u663e\u793a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ishht.com\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ishht.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ishht.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ishht.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ishht.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":0,"href":"https:\/\/ishht.com\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"wp:attachment":[{"href":"https:\/\/ishht.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ishht.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ishht.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}