Wednesday, August 27, 2008

Unix Commands

Command to print file path

To print the file name prefix with path, use this command

find `pwd` -type f

Command to search for text in specific files

find . -type f -name "MSG0710*.xml" -exec grep "Email Confirmation" '{}' \; -print

Command to find files and delete it with confirmation

$ find $HOME/. -name *.txt -ok rm {} \;