1--从当前目录一直往里递归查找
find -depth -name '*.class' -exec grep -l '关键字' {} \;
2--当前目录开始递归,找所有文件
grep "关键字" -rl .
3--当前目录开始递归,但只找jsp文件
grep "关键字" -rl `find -depth -name '*.jsp'`
4--按200m单位分割一个文件,poslogin.log为要分割的文件,a 为分割后的文件名
split -b 200m poslogin.log a
5--截取文件nohup.out的第50到55行,输入到文件a.log中
sed -n '50,55p' nohup.out > a.log
6--在当前目录中,找出包含http://www.baidu.com的文件,并替换为https://www.baidu.com
sed -ir 's#https://www.baidu.com#http://www.baidu.com#g' `grep "http://www.baidu.com" -rl `find -depth -name '*.jsp'``
7--创建软连接
ln -s /picclife/weblogic/wlserver9/user_projects/domains/domain8 domains
删除软连接
rm directnew
提示输入y
8--查看命令位置
whereis ifconfig
9--将本机文件复制到远程服务器上
#scp /home/administrator/news.txt [email protected]:/etc/
10--将远程服务器上的文件复制到本机
scp [email protected]:/picclife/hadoop-2.6.4.tar.gz /picclife
![](/qrcode.jpg)