![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
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! |
|
|||
|
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.. |
|
|||
|
A oneline title with nothing in the msg body wont help...provide an example of what you mean by all this.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
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 | 11-05-2009 12:41 AM |
| ls command to list recursively ONLY subdirectories | HLee1981 | UNIX for Dummies Questions & Answers | 5 | 05-14-2009 03:19 AM |
| Recursively go thorough subdirectories and checkout files | shajiasalim | Shell Programming and Scripting | 3 | 08-13-2008 07:28 AM |
| Concatenate all the files in folder on timestamps | srikanthgr1 | Shell Programming and Scripting | 19 | 08-10-2007 10:21 AM |
| How to move recursively into one folder | patrick99e99 | UNIX for Dummies Questions & Answers | 2 | 06-27-2006 07:50 PM |