- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- General
- >
- Re: Question using the find command -
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- Report Inappropriate Content
10-15-2005 01:48 PM
10-15-2005 01:48 PM
Re: Question using the find command -
for i in `cat /home/listofhosts`
do
find /somedirectory -type f -name $i -exec cat {} \; >> /var/tmp/bigfile
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-15-2005 02:26 PM
10-15-2005 02:26 PM
SolutionCreate a file with each host name in ie
cat /home/listofhosts
host.1
host.2
host.3
then
for i in `cat /home/listofhosts |awk '{print $1}'`
do
echo "details for host $i" >> /var/tmp/file
find /somedirectory -type f -name "$i.cfg" -exec cat {} \; >> /var/tmp/file
done
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-15-2005 02:49 PM
10-15-2005 02:49 PM
Re: Question using the find command -
Again, Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-17-2005 02:05 AM
10-17-2005 02:05 AM
Re: Question using the find command -
One small point to mention; if you are going to cat somewhere around 4000 files to /onebigfile, you better be sure you have the disk space available. In other words, don't try to save the result in /onebigfile. Filling up / is not good.
Just my 2cts.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-17-2005 07:51 AM
10-17-2005 07:51 AM
Re: Question using the find command -
If I understand what you are trying to do I may have a better idea for you.
You have several file names that are scattered about in a file system with 4000 other files.
You want to find all the files with those names and cat them all into one big file.
If thatâ s the case, you donâ t have to find each file individually you can just find all 4000 files once and grep out the names you are looking for and cat those files to your big file
Find . -xdev -print | grep -e "file1" -e "file2" | while read filename
Do
Cat $filename >> $grut.big.file
Done
Or if you have many file names list them in a pattern file and user grep -f patternfile
If thatâ s not what you are trying to do, then ignore this post.
H
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-17-2005 08:43 AM
10-17-2005 08:43 AM
Re: Question using the find command -
I love this forum because each time I need to do something like this, I can come here then come away with a solution.
Again thanks for your response.
- « Previous
-
- 1
- 2
- Next »
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP