Results 1 to 4 of 4
I was going over this article in which the author used locate.
I wanted to know is there anyway to make locate only search in the current directory
>> locate ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-24-2012 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 68
using Locate
I was going over this article in which the author used locate.
I wanted to know is there anyway to make locate only search in the current directory
>> locate ./ "*zip*"
and frankly the results that get displayed do not have zip in them .
How do i make locate only search the current directory ??
- 01-24-2012 #2
To be honest, you might have more luck using find.
Code:man find
Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 01-24-2012 #3Just Joined!
- Join Date
- Oct 2011
- Posts
- 68
I know i am even more familiar and comfortable with find. I wonder why do people even use "locate" other than the fact that its a bit faster however having a serious downside o being inaccurate sometimes. So does this mean locate cant be customized to search in a particular directory ?? I cant seem to find anything on the internet in this regard..
Last edited by zedan85; 01-25-2012 at 12:34 AM.
- 01-24-2012 #4
locate is useful specifically because it will hunt down a file anywhere in your filesystem. It does this by reading a database created by updatedb. I know that's not news to you... it's mentioned in the man page for locate.
But I don't think you can use different search options with locate. This is by design.Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.


Reply With Quote
