Results 1 to 5 of 5
Hi again,
I'm having trouble trying to use the find command to find a directory. I purposely made a directory in:
totallylinux@superpc:/usr/share/azureus/plugins$
Called "OMG" and it's really got me baffled ...
- 06-01-2006 #1Just Joined!
- Join Date
- May 2006
- Posts
- 28
Finding Directories With "Find" Command?
Hi again,
I'm having trouble trying to use the find command to find a directory. I purposely made a directory in:
totallylinux@superpc:/usr/share/azureus/plugins$
Called "OMG" and it's really got me baffled how I can find it in the terminal window. I can easily use the "find" command to find files but for some reason it doesn't allow me to find directories. Anyway here is the command I am using:
find "OMG" -type -d -print
And, sadly, it doesn't find it.
What I would like it to acheive is to find the directory and list it's path. If someone can help me with this issue, it would make me a lot happier
- 06-01-2006 #2
I seldom use the find command and always rely on 'locate'
It might say you need to update your database. If so:Code:locate "OMG"
If it says the database file can't be found then it needs to be created.Code:updatedb
Then try the first command again.Code:updatedb -u
- 06-02-2006 #3Just Joined!
- Join Date
- May 2006
- Posts
- 31
Your syntax is incorrect.
Originally Posted by InvisibleSniper
-print isn't necessary as that is the default.Code:find /directory/to/search -type -d -name "OMG"
- 06-02-2006 #4Just Joined!
- Join Date
- May 2006
- Posts
- 28
I wanted to do a recursive search and search through every directory without specifying any of them. Anyway I managed to do it with my command syntax I was origionally using, the only problem is that I had to login as 'SU' to do it... 'sudo' didn't work for some reason.
- 08-27-2006 #5Just Joined!
- Join Date
- Sep 2005
- Location
- New delhi
- Posts
- 22
Go through www.amitsharma.linuxbloggers.com/how_to_find.htm for further more complicated examples.


Reply With Quote
