linux实用命令行集_2018_lcf

# find /usr/www -name "*host*" -exec sed -n '/52.106.198.29/p' {} \;       查找指定文件显示指定相关内容

# find /tmp/ -type f -name "*test*" -exec sed -i '/127.0.0.1/s/127.0.0.1/192.168.0.1/g' {} \;  

//  查找指定文件,再查找文件指定内容IP行,再将行里指定IP替换成新的IP

# sed '/server_name/s/1././g' /tmp/nginx.conf  -i         匹配文件内容行再替换指定内容

# rsync -atvcr --delete-excluded /usr/www/ 172.17.171.10:/usr/www/     同步本地/usr/www内容到远程主机172.17.171.10:/usr/www

猜你喜欢

转载自blog.csdn.net/cbuy888/article/details/81565581
今日推荐