Operating System - HP-UX
1838653 Members
3734 Online
110128 Solutions
New Discussion

Re: About the find string

 
SOLVED
Go to solution
peterchu
Super Advisor

About the find string

I try the below find command , I want to find all the files the extension is .tmp , it seems not allow to use the -name *.tmp , could suggest what can I do ? thx


find /home/EDP -type f -name *.tmp
4 REPLIES 4
steven Burgess_2
Honored Contributor

Re: About the find string

Hello

find /home/EDP -type f -name "*.tmp"

You need the double quotes so the shell expands the wildcard and doesn't treat it as a literal

Regards

Steve
take your time and think things through
Sยภเl Kย๓คг
Respected Contributor

Re: About the find string

Correct you need to use doublequotes to manipulate some special cases while using wildcards.
so use
#find /home/EDP -type f -name "*.tmp" where "*.tmp" will cover all the files which has .tmp at the end of the filename.

regards
SK
Your imagination is the preview of your life's coming attractions
Petr Simik_1
Valued Contributor
Solution

Re: About the find string

yes close it into strings "" or ''
you can chaing the query if you want to find more

find . -name "*.txt" -name "*.log"
Muthukumar_5
Honored Contributor

Re: About the find string

There characters like * are wild card and we have to delimit it with \ or put in quotes on shell.

You can get it as,


find /home/EDP -type f -name \*.tmp

or

find /home/EDP -type f -name "*.tmp"

- Muthu
Easy to suggest when don't know about the problem!