查看一个目录下所有文件的大小(排除目录)
ls -l | awk '/^[^d]/ {print $9 "\t" $5 }'统计每个java文件中and的个数
find */service/*.java |xargs grep -iwc "and" > aa.txt
linux在不同用户下执行命令
su - jz01 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
su - jz02 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
su - jzr1 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
su - sh01 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
su - shr1 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
su - shcard1 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
su - shm0 -c "rm -rf cdm/dat/* ; cp -R /usr/abs20s/cdm/dat ./cdm/"
修改主机名称: /etc/sysconfig/network
删除一个目录下所有子目录下的某种文件的命令
find . -name "*.o" -exec rm {} \;
find . -name "*.o" |xargs rm -f
find . -name "tj_0*" -exec sed -n 4p >>ee {} \;
tee命令
cat aa.txt |tee bb.txt
作用:将aa.txt中得内容显示在屏幕上得同时,写入到bb.txt中