【fie operation】Find all .log files which haven't been modified for more than 7 days under /tmp directory and move them to tmp/bak directory, please give the command.
mv `find /tmp -name “*.log” -mtime +7` /tmp/bak
【network】how to capture UDP traffics send/recieved by 10.1.1.1 on port 161, please give the command
tcpdump -i eth0 src host 10.1.1.1 dst host 10.1.1.1 and port 161 and udp
tcpdump -i eth0 -nnA 'port 161 and src host 10.1.1.1 and udp'
which one is right?
【shell】replace all 'abc' as 'xyz' in file a.txt
sed -e `\abc\xyz\g` a.txt
【shell】
$$: shell本身的PID
$! : shell最后运行的后台process的PID
$? :上一条命令的返回值
$# :添加到shell的参数的个数
$-: 使用sed命令设定的flag一览
$*
$@
$0: shell本身的文件名
$1 ~ $n:添加到shell的各个参数值