![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To compare selective file in different folders | gmahesh2k | UNIX for Dummies Questions & Answers | 0 | 05-15-2008 02:03 AM |
| Recursive file processing | k_mufasa | Filesystems, Disks and Memory | 4 | 03-24-2008 12:35 PM |
| find file with date and recursive search for a text | rosh0623 | UNIX for Advanced & Expert Users | 10 | 08-16-2006 02:27 PM |
| Selective Umask | baanprog | UNIX for Advanced & Expert Users | 3 | 08-03-2006 09:48 AM |
| extracting recursive data file | bbeugie | UNIX for Dummies Questions & Answers | 1 | 06-16-2004 05:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hello,
I have been trying all sorts of combinations and been royally screwing up my filesystem in the process I have a bunch of .wav files in a hierarchical album/artist etc folder structure and each has a duplicate .w4a file next to it. All I want to do is move all the .w4a files to somewhere else, complete with the hierarchical folder structure, whilst leaving the .wavs where they are. I figured the following would work at the top level of the folder structure: mv -r *.w4a ~/blah/blah/newplace/ Obviously i need to spend less time outside and more on the command line because this doesn't work Sing your praises, I would. Many thanks, L |
|
||||
|
What I would do is copy the top level of the heirarchical file structure i.e.
Code:
cp -r /toplevel ~/blah/blah/newplace/
cd ~/blah/blah/newplace/
find . -type f -name "*.wav" -exec rm -f {} \;
Maybe someone else has a cleaner solution? |
|
||||
|
Thanks, but sadly, I've already tried this.
cp -r *.w4a ~/blah/blah/someplace/ comes back with this: cp: *.m4a: No such file or directory The above command will only move any .w4a files in the current directory, it does not go down recursively - ![]() |
|
|||||
|
Try the full path instead.
or if that fails. try cp -r . ~/to/some/dir. Here is a good link. http://www.brandonhutchinson.com/Copy_directories.html try this... # cd fromdir; tar cf - . | (cd todir; tar xfp ###I think you can change the dot to *.w4a There was a command line that I remembered using cpio that I cant remember... |
|
|||||
|
Quote:
Code:
find . -depth | cpio -pdmv /path/tobe/copied/to Code:
find . -depth -name "*.w4a" | cpio -pdmv /path/tobe/copied/to |
![]() |
| Bookmarks |
| Tags |
| cpio |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|