Problem to command

HuaMin Chen
HuaMin Chen used Ask the Experts™
on
Hi,
I'm not able to find out one folder called "Downloads" by this
find . -name "*ownloads*"

Open in new window

any advice?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mick FinleyNetwork Engineer

Commented:
try using locate instead of 'find' and remove the period after 'find'
HuaMin ChenProblem resolver

Author

Commented:
Sorry, I get this

[huamin@CentOS65x64 /]$ locate -name "*ownloads*"
locate: invalid value `ame' of --limit
Mick FinleyNetwork Engineer

Commented:
remove the -name

locate "*ownloads*"
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Using find followed by a period only looks in folders below the current folder. When I run your command from my home folder, it works:

username ~ $ cd
username ~ $ pwd
/home/username
username ~ $ find . -name "*ownloads*"
./.kde4/share/apps/khtml/easylistdownloadsadblockplusorgeasylistnoelemhide.txt
./.thunderbird/lsqi76kk.default/downloads.json
./.moonchild productions/pale moon/ocmjoebb.default/downloads.sqlite
./Downloads

Open in new window

Mick FinleyNetwork Engineer

Commented:
locate will search all directories, usually used at root level
locate actually looks up the file in a previously indexed database and the database is generally indexed once per day, so any new items may not appear with locate.

Where are you running your find command?

That dot '.' tells find to search in your current folder.  If your current folder doesn't contain the any files or folders that match "*ownloads*", then it won't find anything.

If you want to find a file in a particular directory, then change the dot '.' to the folder name.

Search the entire root folder for "*ownloads*"
find / -name "*ownloads*"

Search the entire /users/ folder for "*ownloads*"
find /users/ -name "*ownloads*"

Search the entire /home/ folder for "*ownloads*"
find /home/ -name "*ownloads*"
Top Expert 2015
Commented:
locate -i download
Were you able to find your [Dd]ownloads folder?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial