![]() |
|
|
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
All,
am quite new to unix shell scripting. my question is 'i have like 23 sub-directiries in source area and same 23 sub-directories in destination area. i want to move all the files of 1st sub-dir in source area to 1st sub-dir in destination area and so on till for 23 sub-dir's. i.e. A B 1 . . . . . . . . . . . . . . 23 -----> 1. . . . . . . . . . . . . . . . . 23 1st sub-dir files from source -> 1st sub-dir in destination 2nd sub-dir files from source -> 2nd sub-dir in destination ......... ......... ......... 23rd sub-dir files from source -> 23rd sub-dir in destination. can we do it with a find command with xargs with mv command or do we need to write a shell script for this? Thanks in advance, vijnat |
|
|||
|
Try that: Code:
(cd A; tar cf - .)|(cd B; tar xf -) It creates an archive of all files and directories in A and extract it on the fly in directory B. Last edited by jlliagre; 12-01-2009 at 12:14 PM.. Reason: removed duplicate post |
|
|||
|
Hi,
It worked great. Thanks for your helping hand. i appreciate it. Thanks vijnat |
| 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 |
| Command to list only files omit directories. | Veenak15 | Shell Programming and Scripting | 5 | 07-09-2009 08:13 AM |
| find command to exclude directories | SmurfGGM | UNIX for Dummies Questions & Answers | 1 | 07-10-2008 08:29 AM |
| command to list a only sub-directories | mail2sant | UNIX for Dummies Questions & Answers | 1 | 05-09-2008 11:11 AM |
| Command for delete the directories which are older than 7 days | sridhar sivakot | HP-UX | 1 | 02-15-2008 09:11 AM |
| How to see only directories using ls command | ravikirankethe | UNIX for Dummies Questions & Answers | 6 | 11-13-2006 06:17 AM |