- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to use find ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:12 AM
тАО04-25-2002 01:12 AM
how to use find ?
find . -name "a*"
and
find . -name a*
?
and how to find a file under current directory but no including sub directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:18 AM
тАО04-25-2002 01:18 AM
Re: how to use find ?
find . -name "a*"
--> find will search for files starting with "a"
find . -name a*
--> command line interpreter will expand "a*" to all files starting with "a" in current directory BEFORE executing the find commmand, so very probably NOT what you want.
to search files ONLY in current directory: how about using "ls" ;-)
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:19 AM
тАО04-25-2002 01:19 AM
Re: how to use find ?
Hope this help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:19 AM
тАО04-25-2002 01:19 AM
Re: how to use find ?
Sorry for bothering, but did you try the manpages ?
Rgds
Alexander M. Ermes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:28 AM
тАО04-25-2002 01:28 AM
Re: how to use find ?
For the default bourne shell (/sbin/sh), no difference between find with double-quotes or find without double-quotes.
# echo $SHELL
/sbin/sh
# find / -name "aaa*" -print | wc -l
97
# find / -name aaa* -print | wc -l
97
No difference in default bash shell as well:
# bash
bash-2.05a# find / -name "aaa*" -print | wc -l
97
bash-2.05a# find / -name aaa* -print | wc -l
97
No difference in korn shell as well:
# ksh
# find / -name "aaa*" -print | wc -l
97
# find / -name aaa* -print | wc -l
97
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:33 AM
тАО04-25-2002 01:33 AM
Re: how to use find ?
-Niraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:38 AM
тАО04-25-2002 01:38 AM
Re: how to use find ?
Note that for Linux and Solaris, you need to use double-quotes in your search term, otherwise your find will not work.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 01:53 AM
тАО04-25-2002 01:53 AM
Re: how to use find ?
Is the same if there is not filename like a*
but is not the same if antonio and alberto file exists. This will find alberto and antonio files in each directory from .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 02:10 AM
тАО04-25-2002 02:10 AM
Re: how to use find ?
Carlo is right.
find / -name aaa* works like find / -name "aaa*" only when no file starting with aaa exists in the / directory. If /aaaxyz exists, then the find will fail because it only searches for file(s) named aaaxyz.
find / -name "aaa*" will work regardless of whether /aaaxyz exists or not and search for files starting with aaa.
# ls /aaa*
/aaaxyz
# find / -name aaa* -print | wc -l
1
# find / -name "aaa*" -print | wc -l
98
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 11:26 PM
тАО04-25-2002 11:26 PM
Re: how to use find ?
how to find a file under current directory but no including sub directory?
If you are on Linux:
find . -maxdepth 1 -name "*.txt" -print
AFAIK, hp's find doesn't have -maxdepth,
you could use some kind of regular expression
(i.e. for my example, write a regexp for
"find all files whose name contains
only one "/" and contains the string ".txt")...
I think that the best solution (as suggested
by Thierry) is to use ls.
Hope this helps
--Luca