- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Help with doing a 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
Forums
Discussions
Discussions
Discussions
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
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
01-16-2006 01:57 PM
01-16-2006 01:57 PM
Here is what I'm wanting to do...I'm wanting to run a find command on a file containing a list of filenames. How would be the best approach to do this? Thanks!!!
Solved! Go to Solution.
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 02:10 PM
01-16-2006 02:10 PM
Re: Help with doing a find
You have a list of filenames and you want to run the find command against it? Are you wanting to locate a specific filename in the file? Are you wanting to see if the files are on the system?
I don't understand your question. A little more explanation please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 02:18 PM
01-16-2006 02:18 PM
Re: Help with doing a find
I hope this helps....
I have a file (we'll call it FileA) that has the following entries...
file1
file2
file3
I want to write a script that will do a find on these entries in FileA. The entries in FileA will change periodically. What would be the best approach? Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 02:27 PM
01-16-2006 02:27 PM
Re: Help with doing a find
u may use grep command alone:
# grep "file"
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 02:33 PM
01-16-2006 02:33 PM
Re: Help with doing a find
I have a file with a list of entries in it (FileA). Looks like...
entry1
entry2
entry3
I want to run a find commands like these:
find / -name entry1
find / -name entry2
etc
The thing is that the entries in FileA change. I need to be able to do a find on / looking for these entries. Any thoughts? Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 02:37 PM
01-16-2006 02:37 PM
SolutionSTARTDIR=/
cat FileA | while read MYFILE
do
find $STARTDIR -type f -name $MYFILE -exec ll {} \;
done
Ideally, you have an idea where the file is located so you don't have to search the entire filesystem. Just set STARTDIR to that directory to speed things up.
Bill Hassell, sysadmin
- Tags:
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 03:39 PM
01-16-2006 03:39 PM
Re: Help with doing a find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2006 02:43 PM
01-17-2006 02:43 PM
Re: Help with doing a find
A good way to bring a machine to its knees is to kick of a number of simultaneous find commands that search most of the file systems.
If this could be an issue for you perhaps have a look at the man page for the nice command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2006 02:52 PM
01-17-2006 02:52 PM
Re: Help with doing a find
Enjoy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2006 08:46 PM
01-17-2006 08:46 PM
Re: Help with doing a find
%cat tt
a
b
%cat tt|xargs -i find . -name {} -exec ll {} \;
-rw-r--r-- 1 pe_EU gpsy 0 Jan 18 02:44 a
-rw-r--r-- 1 pe_EU gpsy 0 Jan 18 02:44 b
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2006 01:08 AM
01-28-2006 01:08 AM
Re: Help with doing a find
find
Where
This would give you a fuller filename (or full if starting from root).
Note that this should be less cpu and IO intensive as it is only doing 1 find, but it really does depend on what you are doing.
Hope this helps,
Brian
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2006 02:52 PM
10-05-2006 02:52 PM