Removing a directory with the rm command (notice we're passing the flag to remove a directory)
注意:无论目录内部是否包含内容,这都会无条件删除目录。
7.2均方根
$ rmdir some-directory
如果目录中没有内容,则rmdir命令将删除目录。
Removing an empty directory with rmdir
8.tail
$ tail somefile
tail命令读取文件并输出文件的最后部分(" tail")。
Output the last num lines, instead of the default (10)
在查看崩溃报告或以前的历史记录日志时,tail命令很有用。 这是处理文件日志时有用的示例。
# tail /var/log/messages Mar 20 12:42:22 hameda1d1c dhclient[4334]: DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x280436dd) Mar 20 12:42:24 hameda1d1c avahi-daemon[2027]: Registering new address record for fe80::4639:c4ff:fe53:4908 on eth0.*. Mar 20 12:42:28 hameda1d1c dhclient[4334]: DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x280436dd) Mar 20 12:42:28 hameda1d1c dhclient[4334]: DHCPACK from 10.76.198.1 (xid=0x280436dd)Mar 20 12:42:30 hameda1d1c avahi-daemon[2027]: Joining mDNS multicast group on interface eth0.IPv4 with address 10.76.199.87. Mar 20 12:42:30 hameda1d1c avahi-daemon[2027]: New relevant interface eth0.IPv4 for mDNS. Mar 20 12:42:30 hameda1d1c avahi-daemon[2027]: Registering new address record for 10.76.199.87 on eth0.IPv4. Mar 20 12:42:30 hameda1d1c NET[4385]: /sbin/dhclient-script : updated /etc/resolv.conf Mar 20 12:42:30 hameda1d1c dhclient[4334]: bound to 10.76.199.87 -- renewal in 74685 seconds. Mar 20 12:45:39 hameda1d1c kernel: usb 3-7: USB disconnect, device number 2
9. wget
$ wget someurl
GNU Wget是一个免费软件包,可使用HTTP,HTTPS,FTP和FTPS(使用最广泛的Internet协议)检索文件。 这是一种非交互式的命令行工具,因此可以轻松地从脚本,CRON作业,不支持X-Windows的终端等中调用。