I'm not sure of what you want to achieve. If I understand correctly, you have a known number, say 13579, and you want to find the file that contains this number.
First, let me say your search may find "false positives", ie. files that contains this number but are not the one you're looking for; so you may have to find your file among those returned by the search.
The easiest way to find this file, provided it is in a suitable directory, is to use a desktop search tool like Beagle or Google Desktop.
Else you may want to try this command (as root):
Code:
find /bin /boot /etc /home /lib /media /opt /root /sbin /usr /var -type f -exec grep -l 13579 '{}' \; 2>/dev/null
- Although the command is long, it is easier than dealing with find's -prune option, in my opinion.
- I don't use grep -r because recursive grep gets easily lost with links, especially in /etc.
Or if you know that the file is in /home for example:
Code:
grep -rl 13579 /home 2>/dev/null
Yves.