5 12 * * * find /var/spool/mqueue/ -type f |xargs rm -f
5 13 * * * echo > /var/spool/mail/root
5 14 * * * rm -f /var/log/*.[0-9]
从哪行开始打印
sed -n '8,$p' /etc/hosts
awk 'NR>8 {print $NF}' /etc/hosts
列转行
paste -s -d "" urfile
awk '{printf "%s",$0}' urfile
sed ':a;$!N;s/\n//;ta;P;D' urfile
sed ':a;N;$!ba;s/\n//g' urfile
在第一行中插入数据
sed -i '1 i\begin;' eyouipb-db-2011-09-21.sql
查看netstat各个状态的连续数
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
转载于:https://blog.51cto.com/zclgood/693251