Wednesday, September 9, 2009

Day to Day

Find and replace

find ./ -name "*.xml" | xargs perl -pi -w -e 's/ port="3268"/ port="389"/g;'

find size of files and sort them in order.

OSR5:
#!/bin/ksh
find $1 -type f -size +2048 -xdev -exec ls -s {} | /bin/sort -brut " "


UW7:

#!/bin/ksh
find $1 -type f -size +2048 -xdev -exec ls -s {} + | /bin/sort -nr

Not sure where I found these one liners.Thanks to the author.

gzip and untar a file in to separate directory , by keeping source as it is.

gzip -dc /tmp/SxRT-5.0MP3-2008-09-11a.dvd4_sfb-sol_x64.tar.gz | tar -xvf -


if you don't want to keep source as it is

just use

tar zxvf /tmp/SxRT-5.0MP3-2008-09-11a.dvd4_sfb-sol_x64.tar.gz


No comments:

Post a Comment