The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
recursively concatenate files in subdirectories with same folder name joyce007 UNIX for Dummies Questions & Answers 2 2 Weeks Ago 12:41 AM
ls command to list recursively ONLY subdirectories HLee1981 UNIX for Dummies Questions & Answers 5 05-14-2009 02:19 AM
Recursively go thorough subdirectories and checkout files shajiasalim Shell Programming and Scripting 3 08-13-2008 06:28 AM
Concatenate all the files in folder on timestamps srikanthgr1 Shell Programming and Scripting 19 08-10-2007 09:21 AM
How to move recursively into one folder patrick99e99 UNIX for Dummies Questions & Answers 2 06-27-2006 06:50 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 1 Week Ago
joyce007 joyce007 is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 3
Question Recursively concatenate files in subdirectories with the same folder name

I'm trying to concatenate files in subdirectories with the same folder name. Say concatenate all the files in the 'current' subdirectories in 'Literature' parent directory.

Literature/USA/current/
Literature/Europe/current/

Can anyone help with it? Thanks a lot!
  #2 (permalink)  
Old 1 Week Ago
thegeek thegeek is offline
Registered User
  
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 429
1. this works, but not to a great extent.

Code:
$ cat script.sh 
for i in `find . -not -iname '.' -type d`
do
echo $i
cd $i
find . -maxdepth 1 -type f -exec cat {} >> ./$i.file \;
cd ..
done
2. you have this same question already here..
recursively concatenate files in subdirectories with same folder name

3. try editing that script to your need, for clarifications come here again..
  #3 (permalink)  
Old 1 Week Ago
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 750
A oneline title with nothing in the msg body wont help...provide an example of what you mean by all this.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0