LinHES Forums http://forums.linhes.org/ |
|
Lost? http://forums.linhes.org/viewtopic.php?f=5&t=4278 |
Page 1 of 1 |
Author: | brendan [ Mon Apr 25, 2005 9:44 pm ] |
Post subject: | Lost? |
For those of us who have a deep-seated fear of learning how to use the `find` command, there's a bit of a cheat. The below (when executed by the root user) will create a database of the file paths on your filesystem in the background. Code: updatedb& When it is done, you can find things pretty quickly using the `locate` command followed by a substring of the filename you are looking for, e.g.: Code: locate ivtv1 or better yet: Code: locate ivtv1|less
I use it all the time when I can't seem to find my own ass-orted files. ![]() Either add the updatedb& command to your startup scripts or enter it by hand on a regular basis. -brendan |
Author: | tjc [ Tue Apr 26, 2005 6:17 pm ] |
Post subject: | |
I'd swear it's there already... Despite my rather cozy relationship with the find command, I also use locate all the time on my system... |
Author: | khrusher [ Wed Apr 27, 2005 7:57 am ] |
Post subject: | |
Im a big fan of find....expecially the -exec parameter Code: find / -name "*.xml" -exec grep someSetting {} /dev/null \;
|
Author: | tjc [ Wed Apr 27, 2005 7:35 pm ] |
Post subject: | |
You're almost always better off using the xargs command rather than exec unless there is something that you absolutely positively want to run once per file or are in the deepest darkest foulest bowels of quoting hell. For example the following is usually substantiallly faster than running one grep per file: Code: find -name "*.xml" -print0 | xargs -0 grep someSetting
|
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |