Posts Tagged ‘shell’

Shell Tips

#1 查找文件修改时间为某一段时间的文件:
touch -c 0901000007 file.start
touch file.end
find /local/Tomcat55/0/cluster/machine0/webapps/Pcclass -newer file.start \! -newer file.end > app_modified_since01Sep.txt -ls
find /jpmorgan/apps/pcclass -newer file.start \! -newer file.end > pcc_modified_since01Sep.txt -ls
#2 find records which dont contain “up to date” in the log.txt file to compile.log
cat log.txt | grep -v ‘up to date’ >> compile.log
#3 获取文件总行数
wc -l /jpmorgan/apps/pcclass/temp/1.txt | cut -c1-8
获取文件夹下文件个数:
ls /etc | [...]