Saturday, September 16, 2006

Perform Recursive Searches for Strings in Hidden Files

I am often asked how to locate certain strings in a directory path. Most of the time, the user is looking for a string they saved into a file in their home directory. But often they forget which file the string was saved to and only remember parts of the string. I had one user who forgot he saved a control sequence to a hidden file. He only remembered a few characters of the string.

This is only an example and for illustration purposes.

# cd $HOME
# find . -type f | xargs grep -i 43Y
./.futureref:43YJJI16
./mydir1/.controlstrings:43Y1ZHFE
./saved/future/.futureref:43YTHI14

Note: More info on hidden files (Find, Copy or Delete Hidden Files)

No comments: