echoecho [OPTIONS] [STRING] - 打印STRING加上一个换行符 -n 不打印末尾的换行符 -e 对STRING进行转义后打印 -E 不对STRING进行转义直接打印find find [-H|L|P] [starting-point] [expression] ...
分类:
其他好文 时间:
2015-04-24 06:40:49
阅读次数:
121
Shell脚本:#!/bin/bashdevices=( $(adb devices|grep device$|awk '{print $1}'|xargs echo) )case ${#devices[@]} in 0 ) echo "can't found a android...
分类:
移动开发 时间:
2015-04-22 17:45:56
阅读次数:
132
在研究hadoop的过程中,遇到一个小难题。问题描述:我需要将文件夹A下的文件拷贝到文件夹B中,但是以hadoop开头的文件不要拷贝。问题解决:ls A|grep -v hadoop|xargs -t -I {} cp {} /B解释:grep -v 是反选。xargs命令的功能是将管道传来的的信息...
分类:
其他好文 时间:
2015-04-18 15:57:47
阅读次数:
111
hadoop fs -ls /source/recommend/at_access | awk -F "/" '{print $NF}' | grep -v $(date +%Y%m%d) | grep -v F | xargs -i sh press_by_handler.sh {} recom....
分类:
其他好文 时间:
2015-04-17 17:35:13
阅读次数:
129
当前目录下:find ./ -size +2048k |xargs du -b|awk '{print $1/1024/1024 "M" $2}'|sort -n。。。。。。2.53318M./images3545s_.jpg2.53318M./images607s_.jpg2.53318M./im...
分类:
系统相关 时间:
2015-04-16 14:08:51
阅读次数:
153
1:查找find . -type f -name "*.html"|xargs grep ‘yourstring’2:查找并替换find -name '要查找的文件名' | xargs perl -pi -e 's|被替换的字符串|替换后的字符串|g'perl -pi -e在Perl 命令中加上-e...
分类:
系统相关 时间:
2015-04-15 17:00:40
阅读次数:
134
行:awk 'NR==2 {print}'sed -n "2, 1p"列:awk '{print $1}'ps -ef | grep -v grep | grep perl | awk '{print $2}'|xargs kill -9lsof -i:6379|sed -n '/4u/p'
分类:
其他好文 时间:
2015-04-15 16:48:46
阅读次数:
148
/usr/local/redis/bin/redis-cli -h xx.xx.xx.xx KEYS "*floor*" | xargs /usr/local/redis/bin/redis-cli DEL
分类:
其他好文 时间:
2015-04-15 16:34:32
阅读次数:
91
sudo find /etc -size +1M -exec echo {} \;
#在/etc目录下找文件大小在1M以上的文件并且显示,文件用换行符隔开。
sudo find /etc -size +1M | xargs echo
#达到-exec相同的功能但是用空格分开寻找到的文件。
#-exec后面的{} \;是不能少的。
find 紧跟的是指定开始寻找的绝对路径,我取当前路径。
find ...
分类:
系统相关 时间:
2015-04-15 09:40:03
阅读次数:
593
#!/bin/bashfind /usr/local/nginx/logs/ -mtime +15 -type f -name *.log | xargs rm -f脚本名字autodellog.sh设置定时器(每天凌晨一点执行)[root@localhost ~]# crontab -e00 01...
分类:
其他好文 时间:
2015-04-11 23:46:51
阅读次数:
160