Wednesday, May 30, 2012

Useful Unix Command Line Script

Find Dead Symbolic Links in The Whole System
find / -type l ! -exec test -r {} \; -print

Find And Replace Text Recursively
find . -type f -print0 | xargs -0 -n32 -P6 sed -i 's/AAA/BBB/g'

Search Text Recursively
find . -type f -print0 | xargs -0 -n32 -P6 grep -iH "ttt"

List The Size of Current Directory
du -sk *

No comments: