常用shell 命令

pa的所有文件中的 i<100 替换成i<2 :

sed -i "" 's/i<100/i<2/g' `grep "i<100" -rl ./pa-*`

所有的文件中的lockForDuration(10)改为3: 

sed -i "" 's/lockForDuration(10)/lockForDuration(3)/g' `grep "lockForDuration(10)" -rl ./`

把window.scrollViews()[0].buttons()[2].tap()替换为window.collectionViews()[0].cells()["icon"].buttons()[0].tap();
man sed 
sed -i "" -E "s/window\.scrollViews\(\)\[0\]\.buttons\(\)\[2\]\.tap\(\)/window.collectionViews()[0].cells()["icon"].buttons()[0].tap()/" `egrep "window\.scrollViews\(\)\[0\]\.buttons\(\)\[2\]\.tap\(\)" -rl ./`

window.buttons()[0].tap()修改为app.tabBar().buttons()[0].tap();
sed -i "" -E "s/window\.buttons\(\)\[0\].tap()/app.tabBar().buttons()[0].tap()/g" `egrep  "window.buttons\(\)\[0\].tap\(\)" -rl ./`

常用命令:
 cp *.xml report/ 
 find ./ -name "*.xml" -exec cp {} report/ \;
 find ./ -name "*.xml" | grep "1.xml"
 zip -r report.zip report
 zip report.zip  *.xml

远程命令:
ssh username@ip"cd /;ls -l"

上传下载命令
scp  username@ip:/Users/xuchuang/Desktop/tests_1/report.zip /Users/cienet/Desktop/
scp username@ip:/Users/zhaoze/Desktop/Microsoft*  ~/Desktop/

进程
ps -ef|grep sshd

查看脚本的执行的时间: 
export HISTTIMEFORMAT="%F %T `whoami` "
history|more

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值