Linux 命令
本文可转载演绎,但需要注明原作者和本文链接。
文章目录
查看该目录下每个文件夹的大小ll-I”..”|awk’{print$9}’|xargs-I{}du-…
批量替换文件名
rename ‘s/.php/.html/‘ *.php
查看该目录下每个文件夹的大小
ll -I “..” | awk ‘{print $9}’ | xargs -I{} du -sh {}
查找并删除符合名称的文件或文件夹
find ./ -name .classpath | xargs rm
查找并替换文本中的内容
打印
grep -rl ‘“version”‘ . | xargs sed ‘s/“version”/AppConstants.HTTP_CLIENT_VERSION/g’
替换
grep -rl ‘“version”‘ . | xargs sed -i ‘s/“version”/AppConstants.HTTP_CLIENT_VERSION/g’
用户组操作
Removing user july from group focusdc
gpasswd -d july focusdc
Adding user july to group anteam
gpasswd -a july anteam
tar -zcvf exclude
tar -zcvf hrsebs-schedule.tgz –exclude hrsebs-schedule/logs –exclude hrsebs-schedule/backup –exclude hrsebs-schedule/webapps –exclude hrsebs-schedule/htdocs/war/greenline-*.war hrsebs-schedule/