Shell,使用sed或awk过滤字符
eg. 过滤clean之后的字符 sed 's/\(.*clean\).*/\1/' file.txt awk -F 'clean' '{print $1""FS}' file.txt »
eg. 过滤clean之后的字符 sed 's/\(.*clean\).*/\1/' file.txt awk -F 'clean' '{print $1""FS}' file.txt »
sed 's/^/keyword/' oldfile.txt >newfile.txt »
wget -c curl -C curl -C - #自动续传 eg. wget -c http://baidu.com/ curl -C curl -C - http://baidu.com/ wget -t 0 反复尝试的次数,0为不限次数 -O »
#!/bin/sh mysql -uroot -p123456 <use test; select * from test where a=10000; »
find /home/mq/ -name 'test-*' | xargs rm -rf »
find /home/mq/ -name '*.conf'|xargs -I {} cp -r {} /home/mq/conf/ »
sed -i -e '/\/home\/this\//!d' file.txt »
grep "keyword" oldfile.txt> newfile.txt »
sed -r 's:\\::g' oldfile.txt >newfile.txt »
#!/bin/sh PIDFILE=/tmp/app.pid echo 'Kill process from PID file' if test -f $PIDFILE ; then PID=`cat $PIDFILE` kill -3 $PID »