{"id":8,"date":"2026-03-31T18:13:29","date_gmt":"2026-03-31T10:13:29","guid":{"rendered":"https:\/\/wp.521991.xyz\/?p=8"},"modified":"2026-03-31T18:13:29","modified_gmt":"2026-03-31T10:13:29","slug":"linux-%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%85%a8","status":"publish","type":"post","link":"https:\/\/wp.521991.xyz\/?p=8","title":{"rendered":"Linux \u547d\u4ee4\u5927\u5168"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">1\u3001\u57fa\u672c\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>uname -m \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784<\/code>\n<code>uname -r \u663e\u793a\u6b63\u5728\u4f7f\u7528\u7684\u5185\u6838\u7248\u672c<\/code>\n<code>dmidecode -q \u663e\u793a\u786c\u4ef6\u7cfb\u7edf\u90e8\u4ef6(SMBIOS \/ DMI) <\/code>\n<code>hdparm -i \/dev\/hda \u7f57\u5217\u4e00\u4e2a\u78c1\u76d8\u7684\u67b6\u6784\u7279\u6027<\/code>\n<code>hdparm -tT \/dev\/sda \u5728\u78c1\u76d8\u4e0a\u6267\u884c\u6d4b\u8bd5\u6027\u8bfb\u53d6\u64cd\u4f5c\u7cfb\u7edf\u4fe1\u606f<\/code>\n<code>arch \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784<\/code>\n<code>uname -m \u663e\u793a\u673a\u5668\u7684\u5904\u7406\u5668\u67b6\u6784<\/code>\n<code>uname -r \u663e\u793a\u6b63\u5728\u4f7f\u7528\u7684\u5185\u6838\u7248\u672c<\/code>\n<code>dmidecode -q \u663e\u793a\u786c\u4ef6\u7cfb\u7edf\u90e8\u4ef6 - (SMBIOS \/ DMI)<\/code>\n<code>hdparm -i \/dev\/hda \u7f57\u5217\u4e00\u4e2a\u78c1\u76d8\u7684\u67b6\u6784\u7279\u6027<\/code>\n<code>hdparm -tT \/dev\/sda \u5728\u78c1\u76d8\u4e0a\u6267\u884c\u6d4b\u8bd5\u6027\u8bfb\u53d6\u64cd\u4f5c<\/code>\n<code>cat \/proc\/cpuinfo \u663e\u793aCPU info\u7684\u4fe1\u606f<\/code>\n<code>cat \/proc\/interrupts \u663e\u793a\u4e2d\u65ad<\/code>\n<code>cat \/proc\/meminfo \u6821\u9a8c\u5185\u5b58\u4f7f\u7528<\/code>\n<code>cat \/proc\/swaps \u663e\u793a\u54ea\u4e9bswap\u88ab\u4f7f\u7528<\/code>\n<code>cat \/proc\/version \u663e\u793a\u5185\u6838\u7684\u7248\u672c<\/code>\n<code>cat \/proc\/net\/dev \u663e\u793a\u7f51\u7edc\u9002\u914d\u5668\u53ca\u7edf\u8ba1<\/code>\n<code>cat \/proc\/mounts \u663e\u793a\u5df2\u52a0\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf<\/code>\n<code>lspci -tv \u7f57\u5217 PCI \u8bbe\u5907<\/code>\n<code>lsusb -tv \u663e\u793a USB \u8bbe\u5907<\/code>\n<code>date \u663e\u793a\u7cfb\u7edf\u65e5\u671f<\/code>\n<code>cal 2007 \u663e\u793a2007\u5e74\u7684\u65e5\u5386\u8868<\/code>\n<code>date 041217002007.00 \u8bbe\u7f6e\u65e5\u671f\u548c\u65f6\u95f4 - \u6708\u65e5\u65f6\u5206\u5e74.\u79d2<\/code>\n<code>clock -w \u5c06\u65f6\u95f4\u4fee\u6539\u4fdd\u5b58\u5230 BIOS<\/code><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u5173\u673a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>shutdown -h now \u5173\u95ed\u7cfb\u7edf(1)<\/code>\n<code>init 0 \u5173\u95ed\u7cfb\u7edf(2)<\/code>\n<code>telinit 0 \u5173\u95ed\u7cfb\u7edf(3)<\/code>\n<code>shutdown -h hours:minutes &amp; \u6309\u9884\u5b9a\u65f6\u95f4\u5173\u95ed\u7cfb\u7edf<\/code>\n<code>shutdown -c \u53d6\u6d88\u6309\u9884\u5b9a\u65f6\u95f4\u5173\u95ed\u7cfb\u7edf<\/code>\n<code>shutdown -r now \u91cd\u542f(1)<\/code>\n<code>reboot \u91cd\u542f(2)<\/code>\n<code>logout \u6ce8\u9500<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u6587\u4ef6\u548c\u76ee\u5f55<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>cd \/home \u8fdb\u5165 '\/ home' \u76ee\u5f55'<\/code><\/li>\n\n\n\n<li><code>cd .. \u8fd4\u56de\u4e0a\u4e00\u7ea7\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cd ..\/.. \u8fd4\u56de\u4e0a\u4e24\u7ea7\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cd \u8fdb\u5165\u4e2a\u4eba\u7684\u4e3b\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cd ~user1 \u8fdb\u5165\u4e2a\u4eba\u7684\u4e3b\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cd - \u8fd4\u56de\u4e0a\u6b21\u6240\u5728\u7684\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>pwd \u663e\u793a\u5de5\u4f5c\u8def\u5f84<\/code><\/li>\n\n\n\n<li><code>ls \u67e5\u770b\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6<\/code><\/li>\n\n\n\n<li><code>ls -F \u67e5\u770b\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6<\/code><\/li>\n\n\n\n<li><code>ls -l \u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u8be6\u7ec6\u8d44\u6599<\/code><\/li>\n\n\n\n<li><code>ls -a \u663e\u793a\u9690\u85cf\u6587\u4ef6<\/code><\/li>\n\n\n\n<li><code>ls *[0-9]* \u663e\u793a\u5305\u542b\u6570\u5b57\u7684\u6587\u4ef6\u540d\u548c\u76ee\u5f55\u540d<\/code><\/li>\n\n\n\n<li><code>tree \u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7531\u6839\u76ee\u5f55\u5f00\u59cb\u7684\u6811\u5f62\u7ed3\u6784(1)<\/code><\/li>\n\n\n\n<li><code>lstree \u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7531\u6839\u76ee\u5f55\u5f00\u59cb\u7684\u6811\u5f62\u7ed3\u6784(2)<\/code><\/li>\n\n\n\n<li><code>mkdir dir1 \u521b\u5efa\u4e00\u4e2a\u53eb\u505a 'dir1' \u7684\u76ee\u5f55'<\/code><\/li>\n\n\n\n<li><code>mkdir dir1 dir2 \u540c\u65f6\u521b\u5efa\u4e24\u4e2a\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>mkdir -p \/tmp\/dir1\/dir2 \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u6811<\/code><\/li>\n\n\n\n<li><code>rm -f file1 \u5220\u9664\u4e00\u4e2a\u53eb\u505a 'file1' \u7684\u6587\u4ef6'<\/code><\/li>\n\n\n\n<li><code>rmdir dir1 \u5220\u9664\u4e00\u4e2a\u53eb\u505a 'dir1' \u7684\u76ee\u5f55'<\/code><\/li>\n\n\n\n<li><code>rm -rf dir1 \u5220\u9664\u4e00\u4e2a\u53eb\u505a 'dir1' \u7684\u76ee\u5f55\u5e76\u540c\u65f6\u5220\u9664\u5176\u5185\u5bb9<\/code><\/li>\n\n\n\n<li><code>rm -rf dir1 dir2 \u540c\u65f6\u5220\u9664\u4e24\u4e2a\u76ee\u5f55\u53ca\u5b83\u4eec\u7684\u5185\u5bb9<\/code><\/li>\n\n\n\n<li><code>mv dir1 new_dir \u91cd\u547d\u540d\/\u79fb\u52a8 \u4e00\u4e2a\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cp file1 file2 \u590d\u5236\u4e00\u4e2a\u6587\u4ef6<\/code><\/li>\n\n\n\n<li><code>cp dir\/* . \u590d\u5236\u4e00\u4e2a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cp -a \/tmp\/dir1 . \u590d\u5236\u4e00\u4e2a\u76ee\u5f55\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>cp -a dir1 dir2 \u590d\u5236\u4e00\u4e2a\u76ee\u5f55<\/code><\/li>\n\n\n\n<li><code>ln -s file1 lnk1 \u521b\u5efa\u4e00\u4e2a\u6307\u5411\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u8f6f\u94fe\u63a5<\/code><\/li>\n\n\n\n<li><code>ln file1 lnk1 \u521b\u5efa\u4e00\u4e2a\u6307\u5411\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u7269\u7406\u94fe\u63a5<\/code><\/li>\n\n\n\n<li><code>touch -t 0712250000 file1 \u4fee\u6539\u4e00\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u65f6\u95f4\u6233 - (YYMMDDhhmm)<\/code><\/li>\n\n\n\n<li><code>file file1 outputs the mime type of the file as text<\/code><\/li>\n\n\n\n<li><code>iconv -l \u5217\u51fa\u5df2\u77e5\u7684\u7f16\u7801<\/code><\/li>\n\n\n\n<li><code>iconv -f fromEncoding -t toEncoding inputFile > outputFile creates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding.<\/code><\/li>\n\n\n\n<li><code>find . -maxdepth 1 -name *.jpg -print -exec convert \"{}\" -resize 80x60 \"thumbs\/{}\" \\; batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick)<\/code><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u6587\u4ef6\u641c\u7d22<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>find \/ -name file1 \u4ece '\/' \u5f00\u59cb\u8fdb\u5165\u6839\u6587\u4ef6\u7cfb\u7edf\u641c\u7d22\u6587\u4ef6\u548c\u76ee\u5f55<\/code>\n<code>find \/ -user user1 \u641c\u7d22\u5c5e\u4e8e\u7528\u6237 'user1' \u7684\u6587\u4ef6\u548c\u76ee\u5f55<\/code>\n<code>find \/home\/user1 -name \\*.bin \u5728\u76ee\u5f55 '\/ home\/user1' \u4e2d\u641c\u7d22\u5e26\u6709'.bin' \u7ed3\u5c3e\u7684\u6587\u4ef6<\/code>\n<code>find \/usr\/bin -type f -atime +100 \u641c\u7d22\u5728\u8fc7\u53bb100\u5929\u5185\u672a\u88ab\u4f7f\u7528\u8fc7\u7684\u6267\u884c\u6587\u4ef6<\/code>\n<code>find \/usr\/bin -type f -mtime -10 \u641c\u7d22\u572810\u5929\u5185\u88ab\u521b\u5efa\u6216\u8005\u4fee\u6539\u8fc7\u7684\u6587\u4ef6<\/code>\n<code>find \/ -name \\*.rpm -exec chmod 755 '{}' \\; \u641c\u7d22\u4ee5 '.rpm' \u7ed3\u5c3e\u7684\u6587\u4ef6\u5e76\u5b9a\u4e49\u5176\u6743\u9650<\/code>\n<code>find \/ -xdev -name \\*.rpm \u641c\u7d22\u4ee5 '.rpm' \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5ffd\u7565\u5149\u9a71\u3001\u6377\u76d8\u7b49\u53ef\u79fb\u52a8\u8bbe\u5907<\/code>\n<code>locate \\*.ps \u5bfb\u627e\u4ee5 '.ps' \u7ed3\u5c3e\u7684\u6587\u4ef6 - \u5148\u8fd0\u884c 'updatedb' \u547d\u4ee4<\/code>\n<code>whereis halt \u663e\u793a\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u3001\u6e90\u7801\u6216man\u7684\u4f4d\u7f6e<\/code>\n<code>which halt \u663e\u793a\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u6216\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u6302\u8f7d\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>mount \/dev\/hda2 \/mnt\/hda2 \u6302\u8f7d\u4e00\u4e2a\u53eb\u505ahda2\u7684\u76d8 - \u786e\u5b9a\u76ee\u5f55 '\/ mnt\/hda2' \u5df2\u7ecf\u5b58\u5728<\/code>\n<code>umount \/dev\/hda2 \u5378\u8f7d\u4e00\u4e2a\u53eb\u505ahda2\u7684\u76d8 - \u5148\u4ece\u6302\u8f7d\u70b9 '\/ mnt\/hda2' \u9000\u51fa<\/code>\n<code>fuser -km \/mnt\/hda2 \u5f53\u8bbe\u5907\u7e41\u5fd9\u65f6\u5f3a\u5236\u5378\u8f7d<\/code>\n<code>umount -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<\/code>\n<code>mount \/dev\/fd0 \/mnt\/floppy \u6302\u8f7d\u4e00\u4e2a\u8f6f\u76d8<\/code>\n<code>mount \/dev\/cdrom \/mnt\/cdrom \u6302\u8f7d\u4e00\u4e2acdrom\u6216dvdrom<\/code>\n<code>mount \/dev\/hdc \/mnt\/cdrecorder \u6302\u8f7d\u4e00\u4e2acdrw\u6216dvdrom<\/code>\n<code>mount \/dev\/hdb \/mnt\/cdrecorder \u6302\u8f7d\u4e00\u4e2acdrw\u6216dvdrom<\/code>\n<code>mount -o loop file.iso \/mnt\/cdrom \u6302\u8f7d\u4e00\u4e2a\u6587\u4ef6\u6216ISO\u955c\u50cf\u6587\u4ef6<\/code>\n<code>mount -t vfat \/dev\/hda5 \/mnt\/hda5 \u6302\u8f7d\u4e00\u4e2aWindows FAT32\u6587\u4ef6\u7cfb\u7edf<\/code>\n<code>mount \/dev\/sda1 \/mnt\/usbdisk \u6302\u8f7d\u4e00\u4e2ausb \u6377\u76d8\u6216\u95ea\u5b58\u8bbe\u5907<\/code>\n<code>mount -t smbfs -o username=user,password=pass \/\/WinClient\/share \/mnt\/share \u6302\u8f7d\u4e00\u4e2awindows\u7f51\u7edc\u5171\u4eab<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001\u78c1\u76d8\u7a7a\u95f4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>df -h \u663e\u793a\u5df2\u7ecf\u6302\u8f7d\u7684\u5206\u533a\u5217\u8868ls -lSr |more \u4ee5\u5c3a\u5bf8\u5927\u5c0f\u6392\u5217\u6587\u4ef6\u548c\u76ee\u5f55du -sh dir1 \u4f30\u7b97\u76ee\u5f55 'dir1' \u5df2\u7ecf\u4f7f\u7528\u7684\u78c1\u76d8\u7a7a\u95f4'du -sk * | sort -rn \u4ee5\u5bb9\u91cf\u5927\u5c0f\u4e3a\u4f9d\u636e\u4f9d\u6b21\u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5927\u5c0frpm -q -a --qf '%10{SIZE}t%{NAME}n' | 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)dpkg-query -W -f='${Installed-Size;10}t${Package}n' | 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)<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">7\u3001\u7528\u6237\u548c\u7fa4\u7ec4<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>groupadd group_name \u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237\u7ec4<\/code><code>groupdel group_name \u5220\u9664\u4e00\u4e2a\u7528\u6237\u7ec4<\/code><code>groupmod -n new_group_name old_group_name \u91cd\u547d\u540d\u4e00\u4e2a\u7528\u6237\u7ec4<\/code><code>useradd -c \"Name Surname \" -g admin -d \/home\/user1 -s \/bin\/bash user1 \u521b\u5efa\u4e00\u4e2a\u5c5e\u4e8e \"admin\" \u7528\u6237\u7ec4\u7684\u7528\u6237<\/code><code>useradd user1 \u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237<\/code><code>userdel -r user1 \u5220\u9664\u4e00\u4e2a\u7528\u6237 ( '-r' \u6392\u9664\u4e3b\u76ee\u5f55)<\/code><code>usermod -c \"User FTP\" -g system -d \/ftp\/user1 -s \/bin\/nologin user1 \u4fee\u6539\u7528\u6237\u5c5e\u6027<\/code><code>passwd \u4fee\u6539\u53e3\u4ee4<\/code><code>passwd user1 \u4fee\u6539\u4e00\u4e2a\u7528\u6237\u7684\u53e3\u4ee4 (\u53ea\u5141\u8bb8root\u6267\u884c)<\/code><code>chage -E 2005-12-31 user1 \u8bbe\u7f6e\u7528\u6237\u53e3\u4ee4\u7684\u5931\u6548\u671f\u9650<\/code><code>pwck \u68c0\u67e5 '\/etc\/passwd' \u7684\u6587\u4ef6\u683c\u5f0f\u548c\u8bed\u6cd5\u4fee\u6b63\u4ee5\u53ca\u5b58\u5728\u7684\u7528\u6237<\/code><code>grpck \u68c0\u67e5 '\/etc\/passwd' \u7684\u6587\u4ef6\u683c\u5f0f\u548c\u8bed\u6cd5\u4fee\u6b63\u4ee5\u53ca\u5b58\u5728\u7684\u7fa4\u7ec4<\/code><code>newgrp group_name \u767b\u9646\u8fdb\u4e00\u4e2a\u65b0\u7684\u7fa4\u7ec4\u4ee5\u6539\u53d8\u65b0\u521b\u5efa\u6587\u4ef6\u7684\u9884\u8bbe\u7fa4\u7ec4<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">8\u3001\u6587\u4ef6\u7684\u6743\u9650<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls -lh \u663e\u793a\u6743\u9650<\/code><code>ls \/tmp | pr -T5 -W$COLUMNS \u5c06\u7ec8\u7aef\u5212\u5206\u62105\u680f\u663e\u793a<\/code><code>chmod 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<\/code><code>chmod go-rwx directory1 \u5220\u9664\u7fa4\u7ec4(g)\u4e0e\u5176\u4ed6\u4eba(o)\u5bf9\u76ee\u5f55\u7684\u8bfb\u5199\u6267\u884c\u6743\u9650<\/code><code>chown user1 file1 \u6539\u53d8\u4e00\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u4eba\u5c5e\u6027<\/code><code>chown -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<\/code><code>chgrp group1 file1 \u6539\u53d8\u6587\u4ef6\u7684\u7fa4\u7ec4<\/code><code>chown user1:group1 file1 \u6539\u53d8\u4e00\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u4eba\u548c\u7fa4\u7ec4\u5c5e\u6027<\/code><code>find \/ -perm -u+s \u7f57\u5217\u4e00\u4e2a\u7cfb\u7edf\u4e2d\u6240\u6709\u4f7f\u7528\u4e86SUID\u63a7\u5236\u7684\u6587\u4ef6<\/code><code>chmod u+s \/bin\/file1 \u8bbe\u7f6e\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684 SUID \u4f4d - \u8fd0\u884c\u8be5\u6587\u4ef6\u7684\u7528\u6237\u4e5f\u88ab\u8d4b\u4e88\u548c\u6240\u6709\u8005\u540c\u6837\u7684\u6743\u9650<\/code><code>chmod u-s \/bin\/file1 \u7981\u7528\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684 SUID\u4f4d<\/code><code>chmod g+s \/home\/public \u8bbe\u7f6e\u4e00\u4e2a\u76ee\u5f55\u7684SGID \u4f4d - \u7c7b\u4f3cSUID \uff0c\u4e0d\u8fc7\u8fd9\u662f\u9488\u5bf9\u76ee\u5f55\u7684<\/code><code>chmod g-s \/home\/public \u7981\u7528\u4e00\u4e2a\u76ee\u5f55\u7684 SGID \u4f4d<\/code><code>chmod o+t \/home\/public \u8bbe\u7f6e\u4e00\u4e2a\u6587\u4ef6\u7684 STIKY \u4f4d - \u53ea\u5141\u8bb8\u5408\u6cd5\u6240\u6709\u4eba\u5220\u9664\u6587\u4ef6<\/code><code>chmod o-t \/home\/public \u7981\u7528\u4e00\u4e2a\u76ee\u5f55\u7684 STIKY \u4f4d<\/code><code>chmod +x \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u548c\u5176\u4ed6\u7528\u6237\u6dfb\u52a0\u6267\u884c\u7684\u6743\u9650<\/code><code>chmod -x \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u548c\u5176\u4ed6\u7528\u6237\u5220\u9664\u6267\u884c\u7684\u6743\u9650<\/code><code>chmod u+x \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u6709\u8005\u6dfb\u52a0\u6267\u884c\u7684\u6743\u9650<\/code><code>chmod g+x \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u5c5e\u7ec4\u6dfb\u52a0\u6267\u884c\u7684\u6743\u9650<\/code><code>chmod o+x \u6587\u4ef6\u8def\u5f84 \u4e3a\u5176\u4ed6\u7528\u6237\u6dfb\u52a0\u6267\u884c\u7684\u6743\u9650<\/code><code>chmod ug+x \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u6dfb\u52a0\u6267\u884c\u7684\u6743\u9650<\/code><code>chmod =wx \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u548c\u5176\u4ed6\u7528\u6237\u6dfb\u52a0\u5199\u3001\u6267\u884c\u7684\u6743\u9650\uff0c\u53d6\u6d88\u8bfb\u6743\u9650<\/code><code>chmod ug=wx \u6587\u4ef6\u8def\u5f84 \u4e3a\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u6dfb\u52a0\u5199\u3001\u6267\u884c\u7684\u6743\u9650\uff0c\u53d6\u6d88\u8bfb\u6743\u9650<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">9\u3001\u6587\u4ef6\u7684\u7279\u6b8a\u5c5e\u6027<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 \u201c+\u201d \u8bbe\u7f6e\u6743\u9650\uff0c\u4f7f\u7528 \u201c-\u201d \u7528\u4e8e\u53d6\u6d88<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chattr +a file1 \u53ea\u5141\u8bb8\u4ee5\u8ffd\u52a0\u65b9\u5f0f\u8bfb\u5199\u6587\u4ef6<\/code><code>chattr +c file1 \u5141\u8bb8\u8fd9\u4e2a\u6587\u4ef6\u80fd\u88ab\u5185\u6838\u81ea\u52a8\u538b\u7f29\/\u89e3\u538b<\/code><code>chattr +d file1 \u5728\u8fdb\u884c\u6587\u4ef6\u7cfb\u7edf\u5907\u4efd\u65f6\uff0cdump\u7a0b\u5e8f\u5c06\u5ffd\u7565\u8fd9\u4e2a\u6587\u4ef6<\/code><code>chattr +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<\/code><code>chattr +s file1 \u5141\u8bb8\u4e00\u4e2a\u6587\u4ef6\u88ab\u5b89\u5168\u5730\u5220\u9664<\/code><code>chattr +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<\/code><code>chattr +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<\/code><code>lsattr \u663e\u793a\u7279\u6b8a\u7684\u5c5e\u6027<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">10\u3001\u6253\u5305\u548c\u538b\u7f29\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>bunzip2 file1.bz2 \u89e3\u538b\u4e00\u4e2a\u53eb\u505a 'file1.bz2'\u7684\u6587\u4ef6<\/code><code>bzip2 file1 \u538b\u7f29\u4e00\u4e2a\u53eb\u505a 'file1' \u7684\u6587\u4ef6<\/code><code>gunzip file1.gz \u89e3\u538b\u4e00\u4e2a\u53eb\u505a 'file1.gz'\u7684\u6587\u4ef6<\/code><code>gzip file1 \u538b\u7f29\u4e00\u4e2a\u53eb\u505a 'file1'\u7684\u6587\u4ef6<\/code><code>gzip -9 file1 \u6700\u5927\u7a0b\u5ea6\u538b\u7f29<\/code><code>rar a file1.rar test_file \u521b\u5efa\u4e00\u4e2a\u53eb\u505a 'file1.rar' \u7684\u5305<\/code><code>rar a file1.rar file1 file2 dir1 \u540c\u65f6\u538b\u7f29 'file1', 'file2' \u4ee5\u53ca\u76ee\u5f55 'dir1'<\/code><code>rar x file1.rar \u89e3\u538brar\u5305<\/code><code>unrar x file1.rar \u89e3\u538brar\u5305<\/code><code>tar -cvf archive.tar file1 \u521b\u5efa\u4e00\u4e2a\u975e\u538b\u7f29\u7684 tarball<\/code><code>tar -cvf archive.tar file1 file2 dir1 \u521b\u5efa\u4e00\u4e2a\u5305\u542b\u4e86 'file1', 'file2' \u4ee5\u53ca 'dir1'\u7684\u6863\u6848\u6587\u4ef6<\/code><code>tar -tf archive.tar \u663e\u793a\u4e00\u4e2a\u5305\u4e2d\u7684\u5185\u5bb9<\/code><code>tar -xvf archive.tar \u91ca\u653e\u4e00\u4e2a\u5305<\/code><code>tar -xvf archive.tar -C \/tmp \u5c06\u538b\u7f29\u5305\u91ca\u653e\u5230 \/tmp\u76ee\u5f55\u4e0b<\/code><code>tar -cvfj archive.tar.bz2 dir1 \u521b\u5efa\u4e00\u4e2abzip2\u683c\u5f0f\u7684\u538b\u7f29\u5305<\/code><code>tar -xvfj archive.tar.bz2 \u89e3\u538b\u4e00\u4e2abzip2\u683c\u5f0f\u7684\u538b\u7f29\u5305<\/code><code>tar -cvfz archive.tar.gz dir1 \u521b\u5efa\u4e00\u4e2agzip\u683c\u5f0f\u7684\u538b\u7f29\u5305<\/code><code>tar -xvfz archive.tar.gz \u89e3\u538b\u4e00\u4e2agzip\u683c\u5f0f\u7684\u538b\u7f29\u5305<\/code><code>zip file1.zip file1 \u521b\u5efa\u4e00\u4e2azip\u683c\u5f0f\u7684\u538b\u7f29\u5305<\/code><code>zip -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<\/code><code>unzip file1.zip \u89e3\u538b\u4e00\u4e2azip\u683c\u5f0f\u538b\u7f29\u5305<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">11\u3001RPM \u5305<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uff08Fedora, Redhat\u53ca\u7c7b\u4f3c\u7cfb\u7edf\uff09<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rpm -ivh package.rpm \u5b89\u88c5\u4e00\u4e2arpm\u5305<\/code><code>rpm -ivh --nodeeps package.rpm \u5b89\u88c5\u4e00\u4e2arpm\u5305\u800c\u5ffd\u7565\u4f9d\u8d56\u5173\u7cfb\u8b66\u544a<\/code><code>rpm -U package.rpm \u66f4\u65b0\u4e00\u4e2arpm\u5305\u4f46\u4e0d\u6539\u53d8\u5176\u914d\u7f6e\u6587\u4ef6<\/code><code>rpm -F package.rpm \u66f4\u65b0\u4e00\u4e2a\u786e\u5b9a\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305<\/code><code>rpm -e package_name.rpm \u5220\u9664\u4e00\u4e2arpm\u5305<\/code><code>rpm -qa \u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305<\/code><code>rpm -qa | grep httpd \u663e\u793a\u6240\u6709\u540d\u79f0\u4e2d\u5305\u542b \"httpd\" \u5b57\u6837\u7684rpm\u5305<\/code><code>rpm -qi package_name \u83b7\u53d6\u4e00\u4e2a\u5df2\u5b89\u88c5\u5305\u7684\u7279\u6b8a\u4fe1\u606f<\/code><code>rpm -qg \"System Environment\/Daemons\" \u663e\u793a\u4e00\u4e2a\u7ec4\u4ef6\u7684rpm\u5305<\/code><code>rpm -ql package_name \u663e\u793a\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<\/code><code>rpm -qc package_name \u663e\u793a\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7684rpm\u5305\u63d0\u4f9b\u7684\u914d\u7f6e\u6587\u4ef6\u5217\u8868<\/code><code>rpm -q package_name --whatrequires \u663e\u793a\u4e0e\u4e00\u4e2arpm\u5305\u5b58\u5728\u4f9d\u8d56\u5173\u7cfb\u7684\u5217\u8868<\/code><code>rpm -q package_name --whatprovides \u663e\u793a\u4e00\u4e2arpm\u5305\u6240\u5360\u7684\u4f53\u79ef<\/code><code>rpm -q package_name --scripts \u663e\u793a\u5728\u5b89\u88c5\/\u5220\u9664\u671f\u95f4\u6240\u6267\u884c\u7684\u811a\u672cl<\/code><code>rpm -q package_name --changelog \u663e\u793a\u4e00\u4e2arpm\u5305\u7684\u4fee\u6539\u5386\u53f2<\/code><code>rpm -qf \/etc\/httpd\/conf\/httpd.conf \u786e\u8ba4\u6240\u7ed9\u7684\u6587\u4ef6\u7531\u54ea\u4e2arpm\u5305\u6240\u63d0\u4f9b<\/code><code>rpm -qp package.rpm -l \u663e\u793a\u7531\u4e00\u4e2a\u5c1a\u672a\u5b89\u88c5\u7684rpm\u5305\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<\/code><code>rpm --import \/media\/cdrom\/RPM-GPG-KEY \u5bfc\u5165\u516c\u94a5\u6570\u5b57\u8bc1\u4e66<\/code><code>rpm --checksig package.rpm \u786e\u8ba4\u4e00\u4e2arpm\u5305\u7684\u5b8c\u6574\u6027<\/code><code>rpm -qa gpg-pubkey \u786e\u8ba4\u5df2\u5b89\u88c5\u7684\u6240\u6709rpm\u5305\u7684\u5b8c\u6574\u6027<\/code><code>rpm -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<\/code><code>rpm -Va \u68c0\u67e5\u7cfb\u7edf\u4e2d\u6240\u6709\u5df2\u5b89\u88c5\u7684rpm\u5305- \u5c0f\u5fc3\u4f7f\u7528<\/code><code>rpm -Vp package.rpm \u786e\u8ba4\u4e00\u4e2arpm\u5305\u8fd8\u672a\u5b89\u88c5<\/code><code>rpm2cpio package.rpm | cpio --extract --make-directories *bin* \u4ece\u4e00\u4e2arpm\u5305\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6<\/code><code>rpm -ivh \/usr\/src\/redhat\/RPMS\/`arch`\/package.rpm \u4ece\u4e00\u4e2arpm\u6e90\u7801\u5b89\u88c5\u4e00\u4e2a\u6784\u5efa\u597d\u7684\u5305<\/code><code>rpmbuild --rebuild package_name.src.rpm \u4ece\u4e00\u4e2arpm\u6e90\u7801\u6784\u5efa\u4e00\u4e2a rpm \u5305<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">12\u3001YUM \u8f6f\u4ef6\u5305\u5347\u7ea7\u5668<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uff08Fedora, RedHat\u53ca\u7c7b\u4f3c\u7cfb\u7edf\uff09<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>yum install package_name \u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e00\u4e2arpm\u5305<\/code><code>yum 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<\/code><code>yum update package_name.rpm \u66f4\u65b0\u5f53\u524d\u7cfb\u7edf\u4e2d\u6240\u6709\u5b89\u88c5\u7684rpm\u5305<\/code><code>yum update package_name \u66f4\u65b0\u4e00\u4e2arpm\u5305<\/code><code>yum remove package_name \u5220\u9664\u4e00\u4e2arpm\u5305<\/code><code>yum list \u5217\u51fa\u5f53\u524d\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684\u6240\u6709\u5305<\/code><code>yum search package_name \u5728rpm\u4ed3\u5e93\u4e2d\u641c\u5bfb\u8f6f\u4ef6\u5305<\/code><code>yum clean packages \u6e05\u7406rpm\u7f13\u5b58\u5220\u9664\u4e0b\u8f7d\u7684\u5305<\/code><code>yum clean headers \u5220\u9664\u6240\u6709\u5934\u6587\u4ef6<\/code><code>yum clean all \u5220\u9664\u6240\u6709\u7f13\u5b58\u7684\u5305\u548c\u5934\u6587\u4ef6<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">13\u3001DEB \u5305<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(Debian, Ubuntu \u4ee5\u53ca\u7c7b\u4f3c\u7cfb\u7edf)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dpkg -i package.deb \u5b89\u88c5\/\u66f4\u65b0\u4e00\u4e2a deb \u5305<\/code><code>dpkg -r package_name \u4ece\u7cfb\u7edf\u5220\u9664\u4e00\u4e2a deb \u5305<\/code><code>dpkg -l \u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u5df2\u7ecf\u5b89\u88c5\u7684 deb \u5305<\/code><code>dpkg -l | grep httpd \u663e\u793a\u6240\u6709\u540d\u79f0\u4e2d\u5305\u542b \"httpd\" \u5b57\u6837\u7684deb\u5305<\/code><code>dpkg -s package_name \u83b7\u5f97\u5df2\u7ecf\u5b89\u88c5\u5728\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u7279\u6b8a\u5305\u7684\u4fe1\u606f<\/code><code>dpkg -L package_name \u663e\u793a\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u7684\u4e00\u4e2adeb\u5305\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<\/code><code>dpkg --contents package.deb \u663e\u793a\u5c1a\u672a\u5b89\u88c5\u7684\u4e00\u4e2a\u5305\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u5217\u8868<\/code><code>dpkg -S \/bin\/ping \u786e\u8ba4\u6240\u7ed9\u7684\u6587\u4ef6\u7531\u54ea\u4e2adeb\u5305\u63d0\u4f9b<\/code><code>APT \u8f6f\u4ef6\u5de5\u5177 (Debian, Ubuntu \u4ee5\u53ca\u7c7b\u4f3c\u7cfb\u7edf)<\/code><code>apt-get install package_name \u5b89\u88c5\/\u66f4\u65b0\u4e00\u4e2a deb \u5305<\/code><code>apt-cdrom install package_name \u4ece\u5149\u76d8\u5b89\u88c5\/\u66f4\u65b0\u4e00\u4e2a deb \u5305<\/code><code>apt-get update \u5347\u7ea7\u5217\u8868\u4e2d\u7684\u8f6f\u4ef6\u5305<\/code><code>apt-get upgrade \u5347\u7ea7\u6240\u6709\u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6<\/code><code>apt-get remove package_name \u4ece\u7cfb\u7edf\u5220\u9664\u4e00\u4e2adeb\u5305<\/code><code>apt-get check \u786e\u8ba4\u4f9d\u8d56\u7684\u8f6f\u4ef6\u4ed3\u5e93\u6b63\u786e<\/code><code>apt-get clean \u4ece\u4e0b\u8f7d\u7684\u8f6f\u4ef6\u5305\u4e2d\u6e05\u7406\u7f13\u5b58<\/code><code>apt-cache search searched-package \u8fd4\u56de\u5305\u542b\u6240\u8981\u641c\u7d22\u5b57\u7b26\u4e32\u7684\u8f6f\u4ef6\u5305\u540d\u79f0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">14\u3001\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cat file1 \u4ece\u7b2c\u4e00\u4e2a\u5b57\u8282\u5f00\u59cb\u6b63\u5411\u67e5\u770b\u6587\u4ef6\u7684\u5185\u5bb9<\/code><code>tac file1 \u4ece\u6700\u540e\u4e00\u884c\u5f00\u59cb\u53cd\u5411\u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9<\/code><code>more file1 \u67e5\u770b\u4e00\u4e2a\u957f\u6587\u4ef6\u7684\u5185\u5bb9<\/code><code>less file1 \u7c7b\u4f3c\u4e8e 'more' \u547d\u4ee4\uff0c\u4f46\u662f\u5b83\u5141\u8bb8\u5728\u6587\u4ef6\u4e2d\u548c\u6b63\u5411\u64cd\u4f5c\u4e00\u6837\u7684\u53cd\u5411\u64cd\u4f5c<\/code><code>head -2 file1 \u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u524d\u4e24\u884c<\/code><code>tail -2 file1 \u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u6700\u540e\u4e24\u884c<\/code><code>tail -f \/var\/log\/messages \u5b9e\u65f6\u67e5\u770b\u88ab\u6dfb\u52a0\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">15\u3001\u6587\u672c\u5904\u7406<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cat file1 file2 ... | command &lt;&gt; file1_in.txt_or_file1_out.txt general syntax for text manipulation using PIPE, STDIN and STDOUT<\/code><code>cat file1 | command( sed, grep, awk, grep, etc...) &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<\/code><code>cat file1 | command( sed, grep, awk, grep, etc...) &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<\/code><code>grep Aug \/var\/log\/messages \u5728\u6587\u4ef6 '\/var\/log\/messages'\u4e2d\u67e5\u627e\u5173\u952e\u8bcd\"Aug\"<\/code><code>grep ^Aug \/var\/log\/messages \u5728\u6587\u4ef6 '\/var\/log\/messages'\u4e2d\u67e5\u627e\u4ee5\"Aug\"\u5f00\u59cb\u7684\u8bcd\u6c47<\/code><code>grep [0-9] \/var\/log\/messages \u9009\u62e9 '\/var\/log\/messages' \u6587\u4ef6\u4e2d\u6240\u6709\u5305\u542b\u6570\u5b57\u7684\u884c<\/code><code>grep Aug -R \/var\/log\/* \u5728\u76ee\u5f55 '\/var\/log' \u53ca\u968f\u540e\u7684\u76ee\u5f55\u4e2d\u641c\u7d22\u5b57\u7b26\u4e32\"Aug\"<\/code><code>sed 's\/stringa1\/stringa2\/g' example.txt \u5c06example.txt\u6587\u4ef6\u4e2d\u7684 \"string1\" \u66ff\u6362\u6210 \"string2\"<\/code><code>sed '\/^$\/d' example.txt \u4eceexample.txt\u6587\u4ef6\u4e2d\u5220\u9664\u6240\u6709\u7a7a\u767d\u884c<\/code><code>sed '\/ *#\/d; \/^$\/d' example.txt \u4eceexample.txt\u6587\u4ef6\u4e2d\u5220\u9664\u6240\u6709\u6ce8\u91ca\u548c\u7a7a\u767d\u884c<\/code><code>echo 'esempio' | tr '[:lower:]' '[:upper:]' \u5408\u5e76\u4e0a\u4e0b\u5355\u5143\u683c\u5185\u5bb9<\/code><code>sed -e '1d' result.txt \u4ece\u6587\u4ef6example.txt \u4e2d\u6392\u9664\u7b2c\u4e00\u884c<\/code><code>sed -n '\/stringa1\/p' \u67e5\u770b\u53ea\u5305\u542b\u8bcd\u6c47 \"string1\"\u7684\u884c<\/code><code>sed -e 's\/ *$\/\/' example.txt \u5220\u9664\u6bcf\u4e00\u884c\u6700\u540e\u7684\u7a7a\u767d\u5b57\u7b26<\/code><code>sed -e 's\/stringa1\/\/g' example.txt \u4ece\u6587\u6863\u4e2d\u53ea\u5220\u9664\u8bcd\u6c47 \"string1\" \u5e76\u4fdd\u7559\u5269\u4f59\u5168\u90e8<\/code><code>sed -n '1,5p;5q' example.txt \u67e5\u770b\u4ece\u7b2c\u4e00\u884c\u5230\u7b2c5\u884c\u5185\u5bb9<\/code><code>sed -n '5p;5q' example.txt \u67e5\u770b\u7b2c5\u884c<\/code><code>sed -e 's\/00*\/0\/g' example.txt \u7528\u5355\u4e2a\u96f6\u66ff\u6362\u591a\u4e2a\u96f6<\/code><code>cat -n file1 \u6807\u793a\u6587\u4ef6\u7684\u884c\u6570<\/code><code>cat example.txt | awk 'NR%2==1' \u5220\u9664example.txt\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5076\u6570\u884c<\/code><code>echo a b c | awk '{print $1}' \u67e5\u770b\u4e00\u884c\u7b2c\u4e00\u680f<\/code><code>echo a b c | awk '{print $1,$3}' \u67e5\u770b\u4e00\u884c\u7684\u7b2c\u4e00\u548c\u7b2c\u4e09\u680f<\/code><code>paste file1 file2 \u5408\u5e76\u4e24\u4e2a\u6587\u4ef6\u6216\u4e24\u680f\u7684\u5185\u5bb9<\/code><code>paste -d '+' file1 file2 \u5408\u5e76\u4e24\u4e2a\u6587\u4ef6\u6216\u4e24\u680f\u7684\u5185\u5bb9\uff0c\u4e2d\u95f4\u7528\"+\"\u533a\u5206<\/code><code>sort file1 file2 \u6392\u5e8f\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9<\/code><code>sort file1 file2 | uniq \u53d6\u51fa\u4e24\u4e2a\u6587\u4ef6\u7684\u5e76\u96c6(\u91cd\u590d\u7684\u884c\u53ea\u4fdd\u7559\u4e00\u4efd)<\/code><code>sort file1 file2 | uniq -u \u5220\u9664\u4ea4\u96c6\uff0c\u7559\u4e0b\u5176\u4ed6\u7684\u884c<\/code><code>sort 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)<\/code><code>comm -1 file1 file2 \u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u53ea\u5220\u9664 'file1' \u6240\u5305\u542b\u7684\u5185\u5bb9<\/code><code>comm -2 file1 file2 \u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u53ea\u5220\u9664 'file2' \u6240\u5305\u542b\u7684\u5185\u5bb9<\/code><code>comm -3 file1 file2 \u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u53ea\u5220\u9664\u4e24\u4e2a\u6587\u4ef6\u5171\u6709\u7684\u90e8\u5206<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">16\u3001\u5b57\u7b26\u8bbe\u7f6e\u548c\u6587\u4ef6\u683c\u5f0f\u8f6c\u6362<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dos2unix filedos.txt fileunix.txt \u5c06\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u683c\u5f0f\u4eceMSDOS\u8f6c\u6362\u6210UNIX<\/code><code>unix2dos fileunix.txt filedos.txt \u5c06\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u683c\u5f0f\u4eceUNIX\u8f6c\u6362\u6210MSDOS<\/code><code>recode ..HTML &lt; page.txt &gt; page.html \u5c06\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u8f6c\u6362\u6210html<\/code><code>recode -l | more \u663e\u793a\u6240\u6709\u5141\u8bb8\u7684\u8f6c\u6362\u683c\u5f0f<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">17\u3001\u6587\u4ef6\u7cfb\u7edf\u5206\u6790<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>badblocks -v \/dev\/hda1 \u68c0\u67e5\u78c1\u76d8hda1\u4e0a\u7684\u574f\u78c1\u5757<\/code><code>fsck \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0alinux\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>fsck.ext2 \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext2\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>e2fsck \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext2\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>e2fsck -j \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext3\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>fsck.ext3 \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0aext3\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>fsck.vfat \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0afat\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>fsck.msdos \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0ados\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><code>dosfsck \/dev\/hda1 \u4fee\u590d\/\u68c0\u67e5hda1\u78c1\u76d8\u4e0ados\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">18\u3001\u521d\u59cb\u5316\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mkfs \/dev\/hda1 \u5728hda1\u5206\u533a\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf<\/code><code>mke2fs \/dev\/hda1 \u5728hda1\u5206\u533a\u521b\u5efa\u4e00\u4e2alinux ext2\u7684\u6587\u4ef6\u7cfb\u7edf<\/code><code>mke2fs -j \/dev\/hda1 \u5728hda1\u5206\u533a\u521b\u5efa\u4e00\u4e2alinux ext3(\u65e5\u5fd7\u578b)\u7684\u6587\u4ef6\u7cfb\u7edf<\/code><code>mkfs -t vfat 32 -F \/dev\/hda1 \u521b\u5efa\u4e00\u4e2a FAT32 \u6587\u4ef6\u7cfb\u7edf<\/code><code>fdformat -n \/dev\/fd0 \u683c\u5f0f\u5316\u4e00\u4e2a\u8f6f\u76d8<\/code><code>mkswap \/dev\/hda3 \u521b\u5efa\u4e00\u4e2aswap\u6587\u4ef6\u7cfb\u7edf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">19\u3001SWAP\u6587\u4ef6\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mkswap \/dev\/hda3 \u521b\u5efa\u4e00\u4e2aswap\u6587\u4ef6\u7cfb\u7edf<\/code><code>swapon \/dev\/hda3 \u542f\u7528\u4e00\u4e2a\u65b0\u7684swap\u6587\u4ef6\u7cfb\u7edf<\/code><code>swapon \/dev\/hda2 \/dev\/hdb3 \u542f\u7528\u4e24\u4e2aswap\u5206\u533a<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">20\u3001\u5907\u4efd<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dump -0aj -f \/tmp\/home0.bak \/home \u5236\u4f5c\u4e00\u4e2a '\/home' \u76ee\u5f55\u7684\u5b8c\u6574\u5907\u4efd<\/code><code>dump -1aj -f \/tmp\/home0.bak \/home \u5236\u4f5c\u4e00\u4e2a '\/home' \u76ee\u5f55\u7684\u4ea4\u4e92\u5f0f\u5907\u4efd<\/code><code>restore -if \/tmp\/home0.bak \u8fd8\u539f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u5907\u4efd<\/code><code>rsync -rogpav --delete \/home \/tmp \u540c\u6b65\u4e24\u8fb9\u7684\u76ee\u5f55<\/code><code>rsync -rogpav -e ssh --delete \/home ip_address:\/tmp \u901a\u8fc7SSH\u901a\u9053rsync<\/code><code>rsync -az -e ssh --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<\/code><code>rsync -az -e ssh --delete \/home\/local ip_addr:\/home\/public \u901a\u8fc7ssh\u548c\u538b\u7f29\u5c06\u672c\u5730\u76ee\u5f55\u540c\u6b65\u5230\u8fdc\u7a0b\u76ee\u5f55<\/code><code>dd bs=1M if=\/dev\/hda | gzip | ssh user@ip_addr 'dd of=hda.gz' \u901a\u8fc7ssh\u5728\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u6267\u884c\u4e00\u6b21\u5907\u4efd\u672c\u5730\u78c1\u76d8\u7684\u64cd\u4f5c<\/code><code>dd if=\/dev\/sda of=\/tmp\/file1 \u5907\u4efd\u78c1\u76d8\u5185\u5bb9\u5230\u4e00\u4e2a\u6587\u4ef6<\/code><code>tar -Puf backup.tar \/home\/user \u6267\u884c\u4e00\u6b21\u5bf9 '\/home\/user' \u76ee\u5f55\u7684\u4ea4\u4e92\u5f0f\u5907\u4efd\u64cd\u4f5c<\/code><code>( cd \/tmp\/local\/ &amp;&amp; tar c . ) | ssh -C user@ip_addr 'cd \/home\/share\/ &amp;&amp; tar x -p' \u901a\u8fc7ssh\u5728\u8fdc\u7a0b\u76ee\u5f55\u4e2d\u590d\u5236\u4e00\u4e2a\u76ee\u5f55\u5185\u5bb9<\/code><code>( tar c \/home ) | ssh -C user@ip_addr 'cd \/home\/backup-home &amp;&amp; tar x -p' \u901a\u8fc7ssh\u5728\u8fdc\u7a0b\u76ee\u5f55\u4e2d\u590d\u5236\u4e00\u4e2a\u672c\u5730\u76ee\u5f55<\/code><code>tar cf - . | (cd \/tmp\/backup ; tar xf - ) \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<\/code><code>find \/home\/user1 -name '*.txt' | xargs cp -av --target-directory=\/home\/backup\/ --parents \u4ece\u4e00\u4e2a\u76ee\u5f55\u67e5\u627e\u5e76\u590d\u5236\u6240\u6709\u4ee5 '.txt' \u7ed3\u5c3e\u7684\u6587\u4ef6\u5230\u53e6\u4e00\u4e2a\u76ee\u5f55<\/code><code>find \/var\/log -name '*.log' | tar cv --files-from=- | bzip2 &gt; log.tar.bz2 \u67e5\u627e\u6240\u6709\u4ee5 '.log' \u7ed3\u5c3e\u7684\u6587\u4ef6\u5e76\u505a\u6210\u4e00\u4e2abzip\u5305<\/code><code>dd 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<\/code><code>dd 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<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">21\u3001\u5149\u76d8<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cdrecord -v gracetime=2 dev=\/dev\/cdrom -eject blank=fast -force \u6e05\u7a7a\u4e00\u4e2a\u53ef\u590d\u5199\u7684\u5149\u76d8\u5185\u5bb9<\/code><code>mkisofs \/dev\/cdrom &gt; cd.iso \u5728\u78c1\u76d8\u4e0a\u521b\u5efa\u4e00\u4e2a\u5149\u76d8\u7684iso\u955c\u50cf\u6587\u4ef6<\/code><code>mkisofs \/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<\/code><code>mkisofs -J -allow-leading-dots -R -V \"Label CD\" -iso-level 4 -o .\/cd.iso data_cd \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u7684iso\u955c\u50cf\u6587\u4ef6<\/code><code>cdrecord -v dev=\/dev\/cdrom cd.iso \u523b\u5f55\u4e00\u4e2aISO\u955c\u50cf\u6587\u4ef6<\/code><code>gzip -dc cd_iso.gz | cdrecord dev=\/dev\/cdrom - \u523b\u5f55\u4e00\u4e2a\u538b\u7f29\u4e86\u7684ISO\u955c\u50cf\u6587\u4ef6<\/code><code>mount -o loop cd.iso \/mnt\/iso \u6302\u8f7d\u4e00\u4e2aISO\u955c\u50cf\u6587\u4ef6<\/code><code>cd-paranoia -B \u4ece\u4e00\u4e2aCD\u5149\u76d8\u8f6c\u5f55\u97f3\u8f68\u5230 wav \u6587\u4ef6\u4e2d<\/code><code>cd-paranoia -- \"-3\" \u4ece\u4e00\u4e2aCD\u5149\u76d8\u8f6c\u5f55\u97f3\u8f68\u5230 wav \u6587\u4ef6\u4e2d\uff08\u53c2\u6570-3\uff09<\/code><code>cdrecord --scanbus \u626b\u63cf\u603b\u7ebf\u4ee5\u8bc6\u522bscsi\u901a\u9053<\/code><code>dd if=\/dev\/hdc | md5sum \u6821\u9a8c\u4e00\u4e2a\u8bbe\u5907\u7684md5sum\u7f16\u7801\uff0c\u4f8b\u5982\u4e00\u5f20 CD<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">22\u3001\u7f51\u7edc<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uff08\u4ee5\u592a\u7f51\u548cWIFI\u65e0\u7ebf\uff09<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ifconfig eth0 \u663e\u793a\u4e00\u4e2a\u4ee5\u592a\u7f51\u5361\u7684\u914d\u7f6e<\/code><code>ifup eth0 \u542f\u7528\u4e00\u4e2a 'eth0' \u7f51\u7edc\u8bbe\u5907<\/code><code>ifdown eth0 \u7981\u7528\u4e00\u4e2a 'eth0' \u7f51\u7edc\u8bbe\u5907<\/code><code>ifconfig eth0 192.168.1.1 netmask 255.255.255.0 \u63a7\u5236IP\u5730\u5740<\/code><code>ifconfig eth0 promisc \u8bbe\u7f6e 'eth0' \u6210\u6df7\u6742\u6a21\u5f0f\u4ee5\u55c5\u63a2\u6570\u636e\u5305 (sniffing)<\/code><code>dhclient eth0 \u4ee5dhcp\u6a21\u5f0f\u542f\u7528 'eth0'<\/code><code>route -n show routing table<\/code><code>route add -net 0\/0 gw IP_Gateway configura default gateway<\/code><code>route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 configure static route to reach network '192.168.0.0\/16'<\/code><code>route del 0\/0 gw IP_gateway remove static route<\/code><code>echo \"1\" &gt; \/proc\/sys\/net\/ipv4\/ip_forward activate ip routing<\/code><code>hostname show hostname of system<\/code><code>host www.example.com lookup hostname to resolve name to ip address and viceversa(1)<\/code><code>nslookup www.example.com lookup hostname to resolve name to ip address and viceversa(2)<\/code><code>ip link show show link status of all interfaces<\/code><code>mii-tool eth0 show link status of 'eth0'<\/code><code>ethtool eth0 show statistics of network card 'eth0'<\/code><code>netstat -tup show all active network connections and their PID<\/code><code>netstat -tupl show all network services listening on the system and their PID<\/code><code>tcpdump tcp port 80 show all HTTP traffic<\/code><code>iwlist scan show wireless networks<\/code><code>iwconfig eth1 show configuration of a wireless network card<\/code><code>hostname show hostname<\/code><code>host www.example.com lookup hostname to resolve name to ip address and viceversa<\/code><code>nslookup www.example.com lookup hostname to resolve name to ip address and viceversa<\/code><code>whois www.example.com lookup on Whois database<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">23\u3001\u5217\u51fa\u76ee\u5f55\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls -a\uff1a\u663e\u793a\u6240\u6709\u6587\u4ef6\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09\uff1b<\/code><code>ls -l\uff1a\u663e\u793a\u8be6\u7ec6\u4fe1\u606f\uff1b<\/code><code>ls -R\uff1a\u9012\u5f52\u663e\u793a\u5b50\u76ee\u5f55\u7ed3\u6784\uff1b<\/code><code>ls -ld\uff1a\u663e\u793a\u76ee\u5f55\u548c\u94fe\u63a5\u4fe1\u606f\uff1b<\/code><code>ctrl+r\uff1a\u5386\u53f2\u8bb0\u5f55\u4e2d\u6240\u641c\u547d\u4ee4\uff08\u8f93\u5165\u547d\u4ee4\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u5b57\u7b26\uff09\uff1b<\/code><code>Linux\u4e2d\u4ee5.\u5f00\u5934\u7684\u6587\u4ef6\u662f\u9690\u85cf\u6587\u4ef6\uff1b<\/code><code>pwd:\u663e\u793a\u5f53\u524d\u76ee\u5f55<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">24\u3001\u67e5\u770b\u6587\u4ef6\u7684\u7c7b\u578b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>file:\u67e5\u770b\u6587\u4ef6\u7684\u7c7b\u578b<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">25\u3001\u590d\u5236\u6587\u4ef6\u76ee\u5f55\u7b49\u64cd\u4f5c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>1\u3001cp\uff1a\u590d\u5236\u6587\u4ef6\u548c\u76ee\u5f55&nbsp;cp\u6e90\u6587\u4ef6\uff08\u6587\u4ef6\u5939\uff09\u76ee\u6807\u6587\u4ef6\uff08\u6587\u4ef6\u5939\uff09<\/code><code><br><\/code><code>\u5e38\u7528\u53c2\u6570\uff1a-r:\u9012\u5f52\u590d\u5236\u6574\u4e2a\u76ee\u5f55\u6811\uff1b-v\uff1a\u663e\u793a\u8be6\u7ec6\u4fe1\u606f\uff1b\u590d\u5236\u6587\u4ef6\u5939\u65f6\u8981\u5728cp\u547d\u4ee4\u540e\u9762\u52a0\u4e00\u4e2a-r\u53c2\u6570\uff1a\u5982\uff1acp -r \u6e90\u6587\u4ef6\u5939 \u76ee\u6807\u6587\u4ef6\u5939<\/code><code><br><\/code><code>2\u3001touch+\u6587\u4ef6\u540d\uff1a\u5f53\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u65f6\u5019\uff0c\u521b\u5efa\u76f8\u5e94\u7684\u6587\u4ef6\uff1b\u5f53\u6587\u4ef6\u5b58\u5728\u7684\u65f6\u5019\uff0c\u4fee\u6539\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\u3002\u6b22\u8fce\u5173\u6ce8\u6211\u4eec\uff0c\u516c\u53f7\u7ec8\u7801\u4e00\u751f\u3002\u529f\u80fd\uff1a\u751f\u6210\u4e00\u4e2a\u7a7a\u6587\u4ef6\u6216\u4fee\u6539\u6587\u4ef6\u7684\u5b58\u53d6\/\u4fee\u6539\u7684\u65f6\u95f4\u8bb0\u5f55\u503c\u3002touch&nbsp;* \uff1a\u5c06\u5f53\u524d\u4e0b\u7684\u6587\u4ef6\u65f6\u95f4\u4fee\u6539\u4e3a\u7cfb\u7edf\u7684\u5f53\u524d\u65f6\u95f4<\/code><code><br><\/code><code>touch&nbsp;\u2013d 20040210 test\uff1a\u5c06test\u6587\u4ef6\u7684\u65e5\u671f\u6539\u4e3a20040210<\/code><code><br><\/code><code>touch&nbsp;abc \uff1a\u82e5abc\u6587\u4ef6\u5b58\u5728\uff0c\u5219\u4fee\u6539\u4e3a\u7cfb\u7edf\u7684\u5f53\u524d\u65f6\u95f4\uff1b\u82e5\u4e0d\u5b58\u5728\uff0c\u5219\u751f\u6210\u4e00\u4e2a\u4e3a\u5f53\u524d\u65f6\u95f4\u7684\u7a7a\u6587\u4ef6<\/code><code><br><\/code><code>3\u3001mv&nbsp;\u6587\u4ef6 \u76ee\u6807\u76ee\u5f55\uff1a\u79fb\u52a8\u6216\u91cd\u547d\u540d\u6587\u4ef6\u6216\u76ee\u5f55\uff08\u5982\u679c\u6307\u5b9a\u6587\u4ef6\u540d\uff0c\u5219\u53ef\u4ee5\u91cd\u547d\u540d\u6587\u4ef6\uff09\u3002\u53ef\u4ee5\u5c06\u6587\u4ef6\u53ca\u76ee\u5f55\u79fb\u5230\u53e6\u4e00\u76ee\u5f55\u4e0b\uff0c\u6216\u66f4\u6539\u6587\u4ef6\u53ca\u76ee\u5f55\u7684\u540d\u79f0\u3002\u683c\u5f0f\u4e3a\uff1amv [\u53c2\u6570]&lt;\u6e90\u6587\u4ef6\u6216\u76ee\u5f55&gt; &lt;\u76ee\u6807\u6587\u4ef6\u6216\u76ee\u5f55&gt;<\/code><code><br><\/code><code>mva.txt&nbsp;..\/\uff1a\u5c06a.txt\u6587\u4ef6\u79fb\u52a8\u4e0a\u5c42\u76ee\u5f55<\/code><code><br><\/code><code>mv&nbsp;a.txt b.txt\uff1a\u5c06a.txt\u6539\u540d\u4e3ab.txt<\/code><code><br><\/code><code>mvdir2&nbsp;..\/\uff1a\u5c06dir2\u76ee\u5f55\u4e0a\u79fb\u4e00\u5c42<\/code><code><br><\/code><code>4\u3001rm\uff1a\u5220\u9664\u6587\u4ef6\uff1b\u5e38\u7528\u53c2\u6570\uff1a-i\uff1a\u4ea4\u4e92\u5f0f&nbsp;-r\uff1a\u9012\u5f52\u7684\u5220\u9664\u5305\u62ec\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u5185\u5bb9<\/code><code><br><\/code><code>5\u3001mkdir&nbsp;+\u6587\u4ef6\u5939\u540d\u79f0\uff1a\u521b\u5efa\u6587\u4ef6\u5939\uff1b6\u3001rm -r +\u6587\u4ef6\u5939\u540d\u79f0\uff1a\u5220\u9664\u6587\u4ef6\u5939\uff08\u7a7a\u6587\u4ef6\u5939\u548c\u975e\u7a7a\u6587\u4ef6\u5939\u90fd\u53ef\u5220\u9664\uff09<\/code><code><br><\/code><code>rmdir&nbsp;\u6587\u4ef6\u5939\u540d\u79f0\uff1a\u5220\u9664\u6587\u4ef6\u5939\uff08\u53ea\u80fd\u5220\u9664\u7a7a\u6587\u4ef6\u5939\uff09<\/code><code><br><\/code><code>7\u3001mkdir&nbsp;-p dir1\/dir2 \uff1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efadir1\u76ee\u5f55\uff0c\u5e76\u5728dir1\u76ee\u5f55\u4e0b\u521b\u5efadir2\u76ee\u5f55\uff0c \u4e5f\u5c31\u662f\u8fde\u7eed\u521b\u5efa\u4e24\u4e2a\u76ee\u5f55\uff08dir1\/\u548cdir1\/dir2\uff09<\/code><code><br><\/code><code>8\u3001rmdir&nbsp;\u2013p dir1\/dir2\uff1a\u5220\u9664dir1\u4e0b\u7684dir2\u76ee\u5f55\uff0c\u82e5dir1\u76ee\u5f55\u4e3a\u7a7a\u4e5f\u5220\u9664\u5b83<\/code><code><br><\/code><code>9\u3001rm&nbsp;* \uff1a\u5220\u9664\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6<\/code><code><br><\/code><code>10\u3001-f\u53c2\u6570\uff1a\u5f3a\u8feb\u5220\u9664\u6587\u4ef6&nbsp;rm \u2013f *.txt\uff1a\u5f3a\u8feb\u5220\u9664\u6240\u6709\u4ee5\u540e\u7f00\u540d\u4e3atxt\u6587\u4ef6<\/code><code><br><\/code><code>11\u3001-i\u53c2\u6570\uff1a\u5220\u9664\u6587\u4ef6\u65f6\u8be2\u95ee<\/code><code><br><\/code><code>rm \u2013i&nbsp;* \uff1a\u5220\u9664\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u4f1a\u6709\u5982\u4e0b\u63d0\u793a\uff1arm:backup:is a directory \u9047\u5230\u76ee\u5f55\u4f1a\u7565\u8fc7<\/code><code><br><\/code><code>rm:&nbsp;remove \u2018myfiles.txt\u2019 ? Y<\/code><code><br><\/code><code>\u5220\u9664\u6587\u4ef6\u65f6\u4f1a\u8be2\u95ee,\u53ef\u6309Y\u6216N\u952e\u8868\u793a\u5141\u8bb8\u6216\u62d2\u7edd\u5220\u9664\u6587\u4ef6&nbsp;<\/code><code><br><\/code><code>12\u3001-r\u53c2\u6570\uff1a\u9012\u5f52\u5220\u9664\uff08\u8fde\u5b50\u76ee\u5f55\u4e00\u540c\u5220\u9664\uff0c\u8fd9\u662f\u4e00\u4e2a\u76f8\u5f53\u5e38\u7528\u7684\u53c2\u6570\uff09<\/code><code><br><\/code><code>rm&nbsp;-r test \uff1a\u5220\u9664test\u76ee\u5f55\uff08\u542btest\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u548c\u5b50\u76ee\u5f55\uff09<\/code><code><br><\/code><code>rm&nbsp;-r *\uff1a\u5220\u9664\u6240\u6709\u6587\u4ef6\uff08\u542b\u5f53\u524d\u76ee\u5f55\u6240\u6709\u6587\u4ef6\u3001\u6240\u6709\u5b50\u76ee\u5f55\u548c\u5b50\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff09 \u4e00\u822c\u5728\u5220\u9664\u76ee\u5f55\u65f6r\u548cf\u4e00\u8d77\u7528\uff0c\u907f\u514d\u9ebb\u70e6<\/code><code><br><\/code><code>rm&nbsp;-rf test \uff1a\u5f3a\u884c\u5220\u9664\u3001\u4e0d\u52a0\u8be2\u95ee<\/code><code><br><\/code><code>13\u3001grep\uff1a\u529f\u80fd\uff1a\u5728\u6587\u4ef6\u4e2d\u641c\u7d22\u5339\u914d\u7684\u5b57\u7b26\u5e76\u8fdb\u884c\u8f93\u51fa<\/code><code><br><\/code><code>\u683c\u5f0f\uff1agrep[\u53c2\u6570]&nbsp;&lt;\u8981\u627e\u7684\u5b57\u4e32&gt; &lt;\u8981\u5bfb\u627e\u5b57 \u4e32\u7684\u6e90\u6587\u4ef6&gt;<\/code><code><br><\/code><code>greplinux&nbsp;test.txt\uff1a\u641c\u7d22test.txt\u6587\u4ef6\u4e2d\u5b57\u7b26\u4e32linux\u5e76\u8f93\u51fa<\/code><code><br><\/code><code>14\u3001ln\u547d\u4ee4<\/code><code><br><\/code><code>\u529f\u80fd\uff1a\u5728\u6587\u4ef6\u548c\u76ee\u5f55\u4e4b\u95f4\u5efa\u7acb\u94fe\u63a5<\/code><code><br><\/code><code>\u683c\u5f0f\uff1aln&nbsp;[\u53c2\u6570] &lt;\u6e90\u6587\u4ef6\u6216\u76ee\u5f55&gt; &lt;\u76ee\u6807\u6587\u4ef6\u6216\u76ee\u5f55&gt;<\/code><code><br><\/code><code>\u94fe\u63a5\u5206\u201c\u8f6f\u94fe\u63a5\u201d\u548c\u201c\u786c\u94fe\u63a5\u201d<\/code><code><br><\/code><code>1.\u8f6f\u94fe\u63a5:<\/code><code><br><\/code><code>ln\u2013s&nbsp;\/usr\/share\/do doc \uff1a\u521b\u5efa\u4e00\u4e2a\u94fe\u63a5\u6587\u4ef6doc,\u5e76\u6307\u5411\u76ee\u5f55\/usr\/share\/do<\/code><code><br><\/code><code>2.\u786c\u94fe\u63a5:<\/code><code><br><\/code><code>ln&nbsp;\/usr\/share\/test hard\uff1a\u521b\u5efa\u4e00\u4e2a\u786c\u94fe\u63a5\u6587\u4ef6hard\uff0c\u8fd9\u65f6\u5bf9\u4e8etest\u6587\u4ef6\u5bf9\u5e94 \u7684\u5b58\u50a8\u533a\u57df\u6765\u8bf4\uff0c\u53c8\u591a\u4e86\u4e00\u4e2a\u6587\u4ef6\u6307\u5411\u5b83<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">26\u3001\u7cfb\u7edf\u5e38\u7528\u547d\u4ee4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u663e\u793a\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>date:\u67e5\u770b\u6216\u8bbe\u7f6e\u5f53\u524d\u7cfb\u7edf\u7684\u65f6\u95f4\uff1a\u683c\u5f0f\u5316\u663e\u793a\u65f6\u95f4\uff1a+%Y--%m--%d\uff1bdate -s:\u8bbe\u7f6e\u5f53\u524d\u7cfb\u7edf\u7684\u65f6\u95f4<\/code><code><br><\/code><code>hwclock(clock)\uff1a\u663e\u793a\u786c\u4ef6\u65f6\u949f\u65f6\u95f4(\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650)\uff1bcal\uff1a\u67e5\u770b\u65e5\u5386<\/code><code><br><\/code><code>\u683c\u5f0fcal [\u53c2\u6570] \u6708\u5e74<\/code><code><br><\/code><code>cal\uff1a\u663e\u793a\u5f53\u6708\u7684\u65e5\u5386 cal4 2004 \uff1a\u663e\u793a2004\u5e744\u6708\u7684\u65e5\u5386<\/code><code><br><\/code><code>cal- y 2003\uff1a\u663e\u793a2003\u5e74\u7684\u65e5\u5386<\/code><code><br><\/code><code>uptime\uff1a\u67e5\u770b\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u8f93\u51fa\u67e5\u770b\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo\uff1a\u663e\u793a\u8f93\u5165\u7684\u5185\u5bb9 \u8ffd\u52a0\u6587\u4ef6echo \"liuyazhuang\" &gt;&gt; liuyazhuang.txt<\/code><code><br><\/code><code>cat\uff1a\u663e\u793a\u6587\u4ef6\u5185\u5bb9,\u4e5f\u53ef\u4ee5\u5c06\u6570\u4e2a\u6587\u4ef6\u5408\u5e76\u6210\u4e00\u4e2a\u6587\u4ef6\u3002\u683c\u5f0f\uff1a\u683c\u5f0f\uff1acat[\u53c2\u6570]&lt;\u6587\u4ef6\u540d&gt;<\/code><code><br><\/code><code>cat test.txt\uff1a\u663e\u793atest.txt\u6587\u4ef6\u5185\u5bb9<\/code><code><br><\/code><code>cat test.txt | more \uff1a\u9010\u9875\u663e\u793atest.txt\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/code><code><br><\/code><code>cat test.txt &gt;&gt; test1.txt \uff1a\u5c06test.txt\u7684\u5185\u5bb9\u9644\u52a0\u5230test1.txt\u6587\u4ef6\u4e4b\u540e<\/code><code><br><\/code><code>cat test.txt test2.txt &gt;readme.txt : \u5c06test.txt\u548ctest2.txt\u6587\u4ef6\u5408\u5e76\u6210readme.txt \u6587\u4ef6<\/code><code><br><\/code><code>head:\u663e\u793a\u6587\u4ef6\u7684\u5934\u51e0\u884c\uff08\u9ed8\u8ba410\u884c\uff09 -n:\u6307\u5b9a\u663e\u793a\u7684\u884c\u6570\u683c\u5f0f\uff1ahead -n \u6587\u4ef6\u540d<\/code><code><br><\/code><code>tail\uff1a\u663e\u793a\u6587\u4ef6\u7684\u672b\u5c3e\u51e0\u884c\uff08\u9ed8\u8ba410\u884c\uff09-n\uff1a\u6307\u5b9a\u663e\u793a\u7684\u884c\u6570 -f\uff1a\u8ffd\u8e2a\u663e\u793a\u6587\u4ef6\u66f4\u65b0 \uff08\u4e00\u822c\u7528\u4e8e\u67e5\u770b\u65e5\u5fd7\uff0c\u547d\u4ee4\u4e0d\u4f1a\u9000\u51fa\uff0c\u800c\u662f\u6301\u7eed\u663e\u793a\u65b0\u52a0\u5165\u7684\u5185\u5bb9\uff09<\/code><code><br><\/code><code>\u683c\u5f0f\uff1a\u683c\u5f0f\uff1atail[\u53c2\u6570]&lt;\u6587\u4ef6\u540d&gt;<\/code><code><br><\/code><code>tail-10 \/etc\/passwd \uff1a\u663e\u793a\/etc\/passwd\/\u6587\u4ef6\u7684\u5012\u657010\u884c\u5185\u5bb9<\/code><code><br><\/code><code>tail+10 \/etc\/passwd \uff1a\u663e\u793a\/etc\/passwd\/\u6587\u4ef6\u4ece\u7b2c10\u884c\u5f00\u59cb\u5230\u672b\u5c3e\u7684\u5185\u5bb9<\/code><code><br><\/code><code>more\uff1a\u7528\u4e8e\u7ffb\u9875\u663e\u793a\u6587\u4ef6\u5185\u5bb9\uff08\u53ea\u80fd\u5411\u4e0b\u7ffb\u9875\uff09<\/code><code><br><\/code><code>more\u547d\u4ee4\u662f\u4e00\u822c\u7528\u4e8e\u8981\u663e\u793a\u7684\u5185\u5bb9\u4f1a\u8d85\u8fc7\u4e00\u4e2a\u753b\u9762\u957f\u5ea6\u7684\u60c5\u51b5\u3002\u4e3a\u4e86\u907f\u514d\u753b \u9762\u663e\u793a\u65f6\u77ac\u95f4\u5c31\u95ea\u8fc7\u53bb\uff0c\u7528\u6237\u53ef\u4ee5\u4f7f\u7528more\u547d\u4ee4\uff0c\u8ba9\u753b\u9762\u5728\u663e\u793a\u6ee1\u4e00\u9875\u65f6\u6682\u505c\uff0c\u6b64\u65f6\u53ef\u6309\u7a7a\u683c\u5065\u7ee7\u7eed\u663e\u793a\u4e0b\u4e00\u4e2a\u753b\u9762\uff0c\u6216\u6309Q\u952e\u505c\u6b62\u663e\u793a\u3002ls -al |more\uff1a\u4ee5\u957f\u683c\u5f62\u5f0f\u663e\u793aetc\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5217\u8868\uff0c\u663e\u793a\u6ee1\u4e00\u4e2a\u753b\u9762\u4fbf\u6682\u505c\uff0c\u53ef \u6309\u7a7a\u683c\u952e\u7ee7\u7eed\u663e\u793a\u4e0b\u4e00\u753b\u9762\uff0c\u6216\u6309Q\u952e\u8df3\u79bb<\/code><code><br><\/code><code>less\uff1a\u7ffb\u9875\u663e\u793a\u6587\u4ef6\u5185\u5bb9\uff08\u5e26\u4e0a\u4e0b\u7ffb\u9875\uff09\u6309\u4e0b\u4e0a\u952e\u5206\u9875\uff0c\u6309q\u9000\u51fa\u3001\u2018<\/code><code><br><\/code><code>less\u547d\u4ee4\u7684\u7528\u6cd5\u4e0emore\u547d\u4ee4\u7c7b\u4f3c\uff0c\u4e5f\u53ef\u4ee5\u7528\u6765\u6d4f\u89c8\u8d85\u8fc7\u4e00\u9875\u7684\u6587\u4ef6\u3002\u6240\u4e0d\u540c \u7684\u662fless \u547d\u4ee4\u9664\u4e86\u53ef\u4ee5\u6309\u7a7a\u683c\u952e\u5411\u4e0b\u663e\u793a\u6587\u4ef6\u5916\uff0c\u8fd8\u53ef\u4ee5\u5229\u7528\u4e0a\u4e0b\u952e\u6765\u5377\u52a8\u6587\u4ef6\u3002\u5f53\u8981\u7ed3\u675f\u6d4f\u89c8\u65f6\uff0c\u53ea\u8981\u5728less\u547d\u4ee4\u7684\u63d0\u793a\u7b26\u201c\uff1a\u201d\u4e0b\u6309Q\u952e\u5373\u53ef\u3002ls -al | less\uff1a\u4ee5\u957f\u683c\u5f62\u5f0f\u5217\u51fa\/etc\u76ee\u5f55\u4e2d\u6240\u6709\u7684\u5185\u5bb9\u3002\u7528\u6237\u53ef\u6309\u4e0a\u4e0b\u952e\u6d4f\u89c8\u6216\u6309Q\u952e\u8df3\u79bb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u67e5\u770b\u786c\u4ef6\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Ispci\uff1a\u67e5\u770bPCI\u8bbe\u5907 -v\uff1a\u67e5\u770b\u8be6\u7ec6\u4fe1\u606f<\/code><code><br><\/code><code>Isusb\uff1a\u67e5\u770bUSB\u8bbe\u5907 -v\uff1a\u67e5\u770b\u8be6\u7ec6\u4fe1\u606f<\/code><code><br><\/code><code>Ismod\uff1a\u67e5\u770b\u52a0\u8f7d\u7684\u6a21\u5757(\u9a71\u52a8)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u5f52\u6863\u3001\u538b\u7f29<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>zip:\u538b\u7f29\u6587\u4ef6 zip liuyazhuang.zip myfile \u683c\u5f0f\u4e3a\uff1a\u201czip \u538b\u7f29\u540e\u7684zip\u6587\u4ef6\u6587\u4ef6\u540d\u201d<\/code><code><br><\/code><code>unzip\uff1a\u89e3\u538b\u6587\u4ef6 unzip liuyazhuang.zip<\/code><code><br><\/code><code>gzip\uff1a\u538b\u7f29\u6587\u4ef6 gzip \u6587\u4ef6\u540d<\/code><code><br><\/code><code>tar\uff1a\u5f52\u6863\u6587\u4ef6<\/code><code><br><\/code><code>tar -cvf out.tar liuyazhuang \u6253\u5305\u4e00\u4e2a\u5f52\u6863\uff08\u5c06\u6587\u4ef6\"liuyazhuang\"\u6253\u5305\u6210\u4e00\u4e2a\u5f52\u6863\uff09<\/code><code><br><\/code><code>tar -xvf liuyazhuang.tar \u91ca\u653e\u4e00\u4e2a\u5f52\u6863\uff08\u91ca\u653eliuyazhuang.tar\u5f52\u6863\uff09<\/code><code><br><\/code><code>tar -cvzf backup.tar.gz\/etc&nbsp;<\/code><code><br><\/code><code>-z\u53c2\u6570\u5c06\u5f52\u6863\u540e\u7684\u5f52\u6863\u6587\u4ef6\u8fdb\u884cgzip\u538b\u7f29\u4ee5\u51cf\u5c11\u5927\u5c0f\u3002-c\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0tar\u6587\u4ef6<\/code><code><br><\/code><code>-v\uff1a\u663e\u793a\u8fd0\u884c\u8fc7\u7a0b\u7684\u4fe1\u606f<\/code><code><br><\/code><code>-f\uff1a\u6307\u5b9a\u6587\u4ef6\u540d<\/code><code><br><\/code><code>-z\uff1a\u8c03\u7528gzip\u538b\u7f29\u547d\u4ee4\u8fdb\u884c\u538b\u7f29<\/code><code><br><\/code><code>-t\uff1a\u67e5\u770b\u538b\u7f29\u6587\u4ef6\u7684\u5185\u5bb9<\/code><code><br><\/code><code>-x\uff1a\u89e3\u5f00tar\u6587\u4ef6<\/code><code><br><\/code><code>tar -cvf test.tar *\uff1a\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210test.tar,\u6269\u5c55\u540d.tar\u9700\u81ea\u884c\u52a0\u4e0a<\/code><code><br><\/code><code>tar -zcvf test.tar.gz *\uff1a\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210test.tar,\u518d\u7528gzip\u547d\u4ee4\u538b\u7f29<\/code><code><br><\/code><code>tar -tf test.tar \uff1a\u67e5\u770btest.tar\u6587\u4ef6\u4e2d\u5305\u62ec\u4e86\u54ea\u4e9b\u6587\u4ef6<\/code><code><br><\/code><code>tar -xvf test.tar \u5c06test.tar\u89e3\u5f00<\/code><code><br><\/code><code>tar -zxvf foo.tar.gz \u89e3\u538b\u7f29<\/code><code><br><\/code><code>gzip\u5404gunzip\u547d\u4ee4<\/code><code><br><\/code><code>gziptest.txt \uff1a\u538b\u7f29\u6587\u4ef6\u65f6\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u53c2\u6570<\/code><code><br><\/code><code>gizp\u2013l test.txt.gz\uff1a\u663e\u793a\u538b\u7f29\u7387<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001\u67e5\u627e<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>locate\uff1a\u5feb\u901f\u67e5\u627e\u6587\u4ef6\u3001\u6587\u4ef6\u5939\uff1alocate keyword<\/code><code><br><\/code><code>\u6b64\u547d\u4ee4\u9700\u8981\u9884\u5148\u5efa\u7acb\u6570\u636e\u5e93\uff0c\u6570\u636e\u5e93\u9ed8\u8ba4\u6bcf\u5929\u66f4\u65b0\u4e00\u6b21\uff0c\u53ef\u7528updatedb\u547d\u4ee4\u624b\u5de5\u5efa\u7acb\u3001\u66f4\u65b0\u6570\u636e\u5e93\u3002\u6b22\u8fce\u5173\u6ce8\u6211\u4eec\uff0c\u516c\u53f7\u7ec8\u7801\u4e00\u751f\u3002find\u67e5\u627e\u4f4d\u7f6e\u67e5\u627e\u53c2\u6570<\/code><code><br><\/code><code>\u5982\uff1afind . -name *liuyazhuang* \u67e5\u627e\u5f53\u524d\u76ee\u5f55\u4e0b\u540d\u79f0\u4e2d\u542b\u6709\"liuyazhuang\"\u7684\u6587\u4ef6<\/code><code><br><\/code><code>find \/ -name *.conf \u67e5\u627e\u6839\u76ee\u5f55\u4e0b\uff08\u6574\u4e2a\u786c\u76d8\uff09\u4e0b\u540e\u7f00\u4e3a.conf\u7684\u6587\u4ef6<\/code><code><br><\/code><code>find \/ -perm 777 \u67e5\u627e\u6240\u6709\u6743\u9650\u662f777\u7684\u6587\u4ef6<\/code><code><br><\/code><code>find \/ -type d \u8fd4\u56de\u6839\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u76ee\u5f55<\/code><code><br><\/code><code>find . -name \"a*\"-exec ls -l {} \\;<\/code><code><br><\/code><code>find\u529f\u80fd\uff1a\u7528\u6765\u5bfb\u627e\u6587\u4ef6\u6216\u76ee\u5f55\u3002\u683c\u5f0f\uff1afind [&lt;\u8def\u5f84&gt;] [\u5339\u914d\u6761\u4ef6]<\/code><code><br><\/code><code>find \/ -name httpd.conf \u641c\u7d22\u7cfb\u7edf\u6839\u76ee\u5f55\u4e0b\u540d\u4e3ahttpd.conf\u7684\u6587\u4ef6<\/code><code><br><\/code><code>7\u3001ctrl+c :\u7ec8\u6b62\u5f53\u524d\u7684\u547d\u4ee4<\/code><code><br><\/code><code>8\u3001who\u6216w\u547d\u4ee4<\/code><code><br><\/code><code>\u529f\u80fd\uff1a\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u4e2d\u6709\u54ea\u4e9b\u7528\u6237\u767b\u5f55<\/code><code><br><\/code><code>\u683c\u5f0f\uff1awho\/w[\u53c2\u6570]<\/code><code><br><\/code><code>9\u3001dmesg\u547d\u4ee4 \u529f\u80fd\uff1a\u663e\u793a\u7cfb\u7edf\u8bca\u65ad\u4fe1\u606f\u3001\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u53f7\u3001\u7269\u7406\u5185\u5b58\u7684\u5927\u5c0f\u4ee5\u53ca\u5176\u5b83\u4fe1\u606f<\/code><code><br><\/code><code>10\u3001df\u547d\u4ee4 \u529f\u80fd\uff1a\u7528\u4e8e\u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u7684\u5404\u4e2a\u5206\u533a\u7684\u5360\u7528\u60c5\u51b5<\/code><code><br><\/code><code>11\u3001du\u547d\u4ee4<\/code><code><br><\/code><code>\u529f\u80fd\uff1a\u67e5\u770b\u67d0\u4e2a\u76ee\u5f55\u4e2d\u5404\u7ea7\u5b50\u76ee\u5f55\u6240\u4f7f\u7528\u7684\u786c\u76d8\u7a7a\u95f4\u6570<\/code><code><br><\/code><code>\u683c\u5f0f\uff1adu [\u53c2\u6570] &lt;\u76ee\u5f55\u540d&gt;<\/code><code><br><\/code><code>12\u3001free\u547d\u4ee4<\/code><code><br><\/code><code>\u529f\u80fd\uff1a\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u5185\u5b58\uff0c\u865a\u62df\u5185\u5b58\uff08\u4ea4\u6362\u7a7a\u95f4\uff09\u7684\u5927\u5c0f\u5360\u7528\u60c5\u51b5<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">27\u3001VIM<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">VIM \u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684\u547d\u4ee4\u884c\u6587\u672c\u7f16\u8f91\u5668\uff0c\u5728 Linux \u4e2d\u901a\u8fc7 vim \u547d\u4ee4\u53ef\u4ee5\u542f\u52a8 vim\u7f16\u8f91\u5668\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u822c\u4f7f\u7528 vim + \u76ee\u6807\u6587\u4ef6\u8def\u5f84\u7684\u5f62\u5f0f\u4f7f\u7528vim\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u76ee\u6807\u6587\u4ef6\u5b58\u5728\uff0c\u5219 vim \u6253\u5f00\u76ee\u6807\u6587\u4ef6\uff0c\u5982\u679c\u76ee\u6807\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5219 vim \u65b0\u5efa\u5e76\u6253\u5f00\u8be5\u6587\u4ef6\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>:q\uff1a\u9000\u51favim\u7f16\u8f91\u5668<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">VIM\u6a21\u5f0f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">vim\u62e5\u6709\u4e09\u79cd\u6a21\u5f0f\uff1a\uff081\uff09\u547d\u4ee4\u6a21\u5f0f\uff08\u5e38\u89c4\u6a21\u5f0f\uff09vim\u542f\u52a8\u540e\uff0c\u9ed8\u8ba4\u8fdb\u5165\u547d\u4ee4\u6a21\u5f0f\uff0c\u4efb\u4f55\u6a21\u5f0f\u90fd\u53ef\u4ee5\u901a\u8fc7esc\u952e\u56de\u5230\u547d\u4ee4\u6a21\u5f0f\uff08\u53ef\u4ee5\u591a\u6309\u51e0\u6b21\uff09\uff0c\u547d\u4ee4\u6a21\u5f0f\u4e0b\u53ef\u4ee5\u952e\u5165\u4e0d\u540c\u7684\u547d\u4ee4\u5b8c\u6210\u9009\u62e9\u3001\u590d\u5236\u3001\u7c98\u8d34\u3001\u64a4\u9500\u7b49\u64cd\u4f5c\u3002\u547d\u540d\u6a21\u5f0f\u5e38\u7528\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>i\uff1a\u5728\u5149\u6807\u524d\u63d2\u5165\u6587\u672c\uff1b<\/li>\n\n\n\n<li>o\uff1a\u5728\u5f53\u524d\u884c\u7684\u4e0b\u9762\u63d2\u5165\u65b0\u884c\uff1b<\/li>\n\n\n\n<li>dd\uff1a\u5220\u9664\u6574\u884c\uff1b<\/li>\n\n\n\n<li>yy\uff1a\u5c06\u5f53\u524d\u884c\u7684\u5185\u5bb9\u653e\u5165\u7f13\u51b2\u533a\uff08\u590d\u5236\u5f53\u524d\u884c\uff09<\/li>\n\n\n\n<li>n+yy\uff1a\u5c06n\u884c\u7684\u5185\u5bb9\u653e\u5165\u7f13\u51b2\u533a\uff08\u590d\u5236n\u884c\uff09<\/li>\n\n\n\n<li>p\uff1a\u5c06\u7f13\u51b2\u533a\u4e2d\u7684\u6587\u672c\u653e\u5165\u5149\u6807\u540e\uff08\u7c98\u8d34\uff09<\/li>\n\n\n\n<li>u\uff1a\u64a4\u9500\u4e0a\u4e00\u4e2a\u64cd\u4f5c<\/li>\n\n\n\n<li>r\uff1a\u66ff\u6362\u5f53\u524d\u5b57\u7b26<\/li>\n\n\n\n<li>\/\uff1a\u67e5\u627e\u5173\u952e\u5b57<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\uff082\uff09\u63d2\u5165\u6a21\u5f0f\u5728\u547d\u4ee4\u6a21\u5f0f\u4e0b\u6309 \u201c i \u201c\u952e\uff0c\u5373\u53ef\u8fdb\u5165\u63d2\u5165\u6a21\u5f0f\uff0c\u5728\u63d2\u5165\u6a21\u5f0f\u53ef\u4ee5\u8f93\u5165\u7f16\u8f91\u6587\u672c\u5185\u5bb9\uff0c\u4f7f\u7528esc\u952e\u53ef\u4ee5\u8fd4\u56de\u547d\u4ee4\u6a21\u5f0f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff083\uff09ex\u6a21\u5f0f\u5728\u547d\u4ee4\u6a21\u5f0f\u4e2d\u6309\u201d : \u201c\u952e\u53ef\u4ee5\u8fdb\u5165ex\u6a21\u5f0f\uff0c\u5149\u6807\u4f1a\u79fb\u52a8\u5230\u5e95\u90e8\uff0c\u5728\u8fd9\u91cc\u53ef\u4ee5\u4fdd\u5b58\u4fee\u6539\u6216\u9000\u51favim\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ex\u6a21\u5f0f\u5e38\u7528\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>:w \u4fdd\u5b58\u5f53\u524d\u7684\u4fee\u6539<\/li>\n\n\n\n<li>:q \u9000\u51fa<\/li>\n\n\n\n<li>:q! \u5f3a\u5236\u9000\u51fa\uff0c\u4fdd\u5b58\u4fee\u6539<\/li>\n\n\n\n<li>\ud83d\ude21 \u4fdd\u5b58\u5e76\u9000\u51fa\uff0c\u76f8\u5f53\u4e8e:wq<\/li>\n\n\n\n<li>:set number \u663e\u793a\u884c\u53f7<\/li>\n\n\n\n<li>:! \u7cfb\u7edf\u547d\u4ee4 \u6267\u884c\u4e00\u4e2a\u7cfb\u7edf\u547d\u4ee4\u5e76\u663e\u793a\u7ed3\u679c<\/li>\n\n\n\n<li>:sh \u5207\u6362\u5230\u547d\u4ee4\u884c\uff0c\u4f7f\u7528ctrl+d\u5207\u6362\u56devim<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">28\u3001\u8f6f\u4ef6\u5305\u7ba1\u7406\u547d\u4ee4(RPM)1\u3001\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u4f7f\u7528RPM\u547d\u4ee4\u7684\u5b89\u88c5\u6a21\u5f0f\u53ef\u4ee5\u5c06\u8f6f\u4ef6\u5305\u5185\u6240\u6709\u7684\u7ec4\u4ef6\u653e\u5230\u7cfb\u7edf\u4e2d\u7684\u6b63\u786e\u8def\u5f84\uff0c\u5b89\u88c5\u8f6f\u4ef6\u5305\u7684\u547d\u4ee4\u662f\uff1arpm \u2013ivh wu-ftpd-2.6.2-8.i386.rpm<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">i\uff1a\u4f5c\u7528rpm\u7684\u5b89\u88c5\u6a21\u5f0f\uff0cv: \u6821\u9a8c\u6587\u4ef6\u4fe1\u606f\uff0ch: \u4ee5\uff03\u53f7\u663e\u793a\u5b89\u88c5\u8fdb\u5ea6\u30022\u3001\u8f6f\u4ef6\u5305\u7684\u5220\u9664\u5220\u9664\u6a21\u5f0f\u4f1a\u5c06\u6307\u5b9a\u8f6f\u4ef6\u5305\u7684\u5185\u5bb9\u5168\u90e8\u5220\u9664\uff0c\u4f46\u5e76\u4e0d\u5305\u62ec\u5df2\u66f4\u6539\u8fc7\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5220\u9664RPM\u8f6f\u4ef6\u5305\u7684\u547d\u4ee4\u5982\u4e0b\uff1arpm -e wu-ftpd\u6ce8\u610f\uff1a\u8fd9\u91cc\u5fc5\u987b\u4f7f\u7528\u8f6f\u4ef6\u540d\u201cwu-ftpd\u201d\u6216\u201dwu-ftpd-2.6.2-8\u800c\u4e0d\u662f\u4f7f\u7528\u5f53\u521d\u5b89\u88c5\u65f6\u7684\u8f6f\u4ef6\u5305\u540d.wu-ftpd-2.6.2-8.i386.rpm<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u8f6f\u4ef6\u5305\u5347\u7ea7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5347\u7ea7\u6a21\u5f0f\u4f1a\u5b89\u88c5\u7528\u6237\u6240\u6307\u5b9a\u7684\u66f4\u65b0\u7248\u672c\uff0c\u5e76\u5220\u9664\u5df2\u5b89\u88c5\u5728\u7cfb\u7edf\u4e2d\u7684\u76f8\u540c\u8f6f\u4ef6\u5305\uff0c\u5347\u7ea7\u8f6f\u4ef6\u5305\u547d\u4ee4\u5982\u4e0b\uff1arpm -Uvh wu-ftpd-2.6.2-8.i386.rpm -Uvh\uff1a\u5347\u7ea7\u53c2\u65704\u3001\u8f6f\u4ef6\u5305\u66f4\u65b0\u66f4\u65b0\u6a21\u5f0f\u4e0b\uff0crpm\u547d\u4ee4\u4f1a\u68c0\u67e5\u5728\u547d\u4ee4\u884c\u4e2d\u6240\u6307\u5b9a\u7684\u8f6f\u4ef6\u5305\u662f\u5426\u6bd4\u7cfb\u7edf\u4e2d\u539f\u6709\u7684\u8f6f\u4ef6 \u5305\u66f4\u65b0\u3002\u5982\u679c\u60c5\u51b5\u5c5e\u5b9e\uff0crpm\u547d\u4ee4\u4f1a\u81ea\u52a8\u66f4\u65b0\u6307\u5b9a\u7684\u8f6f\u4ef6\u5305\uff1b\u53cd\u4e4b\uff0c\u82e5\u7cfb\u7edf\u4e2d\u5e76\u6ca1\u6709\u6307\u5b9a\u8f6f\u4ef6\u5305\u7684\u8f83\u65e7\u7248\u672c\uff0crpm\u547d\u4ee4\u5e76\u4e0d\u4f1a\u5b89\u88c5\u6b64\u8f6f\u4ef6\u5305\u3002\u800c\u5728\u5347\u7ea7\u6a21\u5f0f\u4e0b\uff0c\u4e0d\u7ba1\u7cfb\u7edf\u4e2d\u662f\u5426\u6709\u8f83\u65e7\u7684\u7248\u672c\uff0crpm\u547d\u4ee4\u90fd\u4f1a\u5b89\u88c5\u6307\u5b9a\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm \u2013Fvhwu-ftpd-2.6.2-8.i386.rpm -Fvh\uff1a\u66f4\u65b0\u53c2\u6570<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u8f6f\u4ef6\u5305\u67e5\u8be2\u82e5\u8981\u83b7\u53d6RPM\u8f6f\u4ef6\u5305\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528\u67e5\u8be2\u6a21\u5f0f\u3002\u4f7f\u7528-q\u53c2\u6570\u53ef\u67e5\u8be2\u4e00\u4e2a\u5df2 \u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u7684\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm&nbsp;\u2013q wu-ftpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u8f6f\u4ef6\u5305\u6240\u5b89\u88c5\u7684\u4f4d\u7f6e\uff1arpm \u2013ql package-name<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm \u2013ql\u00a0xv\u00a0(l\u53c2\u6570\uff1a\u663e\u793a\u6587\u4ef6\u5217\u8868)<br><br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u57fa\u672c\u547d\u4ee4 2\u3001\u5173\u673a 3\u3001\u6587\u4ef6\u548c\u76ee\u5f55 4\u3001\u6587\u4ef6\u641c\u7d22 5\u3001\u6302\u8f7d\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf 6\u3001\u78c1\u76d8\u7a7a\u95f4 7\u3001\u7528\u6237\u548c\u7fa4\u7ec4 gr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8"}],"version-history":[{"count":1,"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=\/wp\/v2\/posts\/8\/revisions"}],"predecessor-version":[{"id":9,"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=\/wp\/v2\/posts\/8\/revisions\/9"}],"wp:attachment":[{"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.521991.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}