- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: find in root
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-2007 04:18 PM - edited тАО10-05-2011 08:14 PM
тАО04-25-2007 04:18 PM - edited тАО10-05-2011 08:14 PM
Re: find in root
>any faster way of searching?
As HGH, JRF and Clay (Plan B) have suggested, you want to do one find, then grep with your list of files. Your original while/find would do N finds.
One advantage of Plan B is that you can look for a filename that wasn't in your "file".
> find / -xdev -type f -name myfile -o -name yourfile -o -name "her*" -o -name "his*"
If you are going to mix AND with OR, you need to use ():
# find / -xdev -type f \( -name myfile -o -name yourfile -o -name "her*" -o -name "his*" \)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2007 07:49 PM
тАО04-27-2007 07:49 PM
Re: find in root
You can add -type f (type is file, -d dir, etc.)
(find / -type f -name $FILENAME)
or even add -mtime -12 (within the last 12 days) or +12 (12 + days)
(find . -type f -mtime -1300 -name $FILENAME)
to make it faster the search operation.
Also see the -atime, -mtime and -user (owner of the file, etc to make your search faster.
See man find
Rasheed Tamton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2007 12:18 AM
тАО04-28-2007 12:18 AM
Re: find in root
> filesystem (root /).
> Its not tat i want to search in root. I
> just gave an example.
Sometimes it's helpful to ask the question
for which you actually want the answer.
> cat file|while read FILENAME
Knowing, even approximately, what is in
"file" might also be helpful in deciding
which of the techniques already suggested
would be good or bad.
- « Previous
-
- 1
- 2
- Next »