How to search all directories for a file in bash
I know I can search with the KDE search function, but how would I search for a file if I did not know what directory it was located in? I was looking for 'xorg.conf'. I went into bash and typed 'whereis xorg.conf' but it returned "xorg". The file turned out to be in 'etc/X11'. I guess a bash command that would open the lost file would work, but is there a way to get bash to tell you the full path?
|
Code:
find / -type f -iname xorg.conf |
For your instance, try 'locate xorg.conf'.
|
thanks! is there a way to force the shell to stop searching? this would be done by using ctrl-break in Windows, is there an equivalent?
|
Ctrl-c should terminate the search.
|
The locate command uses a database catalog that is rebuilt nightly. Unless your files are newer than a day or so, you should be able to use locate. It is much faster than the find command. Find is great for finding files that have been newly added.
|
type:
updatebd # followed by locate <file being searched> The updatedb command will update the database immediately. Deion "Mule" Christopher |
I would have thought that with slackware you would need to add
Code:
Code:
Code:
|
All times are GMT -5. The time now is 09:23 PM. |