Tuesday, June 26, 2012

Some linux utils

for i in `find -iname '*.jar'` ; do jar tvf $i | grep javax/xml/bind/util/JAXBResult.class && echo $i ; done;


java com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck


To find files modified within 2 time range

touch -t 201112220000 start
touch -t 201112240000 stop
find . -newer start \! -newer stop
#to exclude with grep
find . -type f -newer start \! -newer stop | grep -v -e 'CVS' -e '.settings' -e 'target' -e '.classpath' -e '.project'
http://unix.stackexchange.com/questions/29245/how-to-list-files-that-were-changed-in-a-certain-range-of-time
To Remove extra spaces in file :)
for f in `find $dd -type f -iname *.jsp`; do sed -i 's/[ \t]*$/ /' $f; done