Matt Posted April 30, 2008 Report Share Posted April 30, 2008 I have a music collection which I want to back up. All of my mp3s are in a music folder, with subfolders of albums/artists/etc. I'd like a command that will copy only the mp3s (i.e. don't copy album art or anything like that) and preserve the subfolder structure.Thanks,Matt Quote Link to post Share on other sites
jcl Posted April 30, 2008 Report Share Posted April 30, 2008 (edited) Bit of a roundabout way: $ cp -lr $COLLECTION $COPY$ find $COPY -type f ! -iname '*.mp3' -delete$ mv $COPY $DESTINATION$COPY is a scratch directory on the same partition as the collection, $DESTINATION is the final destination. You can remove the -delete option and add -depth before -type in the find to see what files will deleted.Alternatively, if you don't mind the extra copying, you can just cp -r to the destination and run the above find there. Edited April 30, 2008 by jcl Quote Link to post Share on other sites
Matt Posted May 1, 2008 Author Report Share Posted May 1, 2008 Thanks jcl. Worked perfectly! Quote Link to post Share on other sites
iccaros Posted May 1, 2008 Report Share Posted May 1, 2008 at work we have contest to see who can make a script smaller. the ideal is to take a working multi line script or set of commands and make it as small as possiblehere is a one liner for the mp3 movefind $SOURCEFOLDER -name "*.mp3" -exec cp {} $DESTINATION \;if you are at the root of your home folder put a . for the source folder to get all mp3 files no matter where in home they may be. Quote Link to post Share on other sites
jcl Posted May 2, 2008 Report Share Posted May 2, 2008 (edited) Doesn't work: ~/tmp/m :)$ mkdir foo foo/bar~/tmp/m :)$ touch foo/bar/a.mp3 foo/bar/b.mp3~/tmp/m :)$ find foofoofoo/barfoo/bar/a.mp3foo/bar/b.mp3~/tmp/m :)$ find foo/ -name "*.mp3" -exec cp {} foo.bak \;~/tmp/m :)$ ls -ltotal 4drwx------ 3 jcl jcl 4096 2008-05-01 22:21 foo-rw------- 1 jcl jcl 0 2008-05-01 22:21 foo.bak~/tmp/m :)$ rm foo.bak~/tmp/m :)$ mkdir foo.bak~/tmp/m :)$ find foo/ -name "*.mp3" -exec cp {} foo.bak \;~/tmp/m :)$ find foo.bak/foo.bak/foo.bak/a.mp3foo.bak/b.mp3If the target isn't a directory, it's overwritten by each file in turn; if it is a directory, it's left with a flattened copy of the source tree (tree structure isn't preserved). Edited May 2, 2008 by jcl Quote Link to post Share on other sites
iccaros Posted May 2, 2008 Report Share Posted May 2, 2008 (edited) ---EDIT--Sorry missread.. you are right.. I did not keep the structure and I missed that whole partthis will keep the structure and place the files in a nice tgz for backup and restorefind /home/huskeyw -name "*.gif" -print0 | xargs -0t tar --no-recursion -PSczf /tmp/find/gif.tgzyou could untar it right after to get the same output, but its not one commandfind /home/huskeyw -name "*.gif" -print0 | xargs -0t tar --no-recursion -PSczf /tmp/find/gif.tgz;cd /tmp/find/;tar zxvf gif.tgzhope this helps someone.I left the original post so you can see what I was thinking.. also to point out.. that I feel like a dum A$$ after rereading you response..it works for me, but I put to copy to a folder not a filehuskeyw@ubuntu-laptop:/tmp$ lsgconfd-huskeyw orbit-huskeyw seahorse-aoi2Cl Tracker-huskeyw.5990keyring-cYDBha pulse-huskeyw tmp.jZvSSS5741 virtual-huskeyw.uBgb8Enote noting in tmp so we create a folder to put my gif fileshuskeyw@ubuntu-laptop:/tmp$ mkdir findnow lets capture a list of all gif files I have in my home folderfind /home/huskeyw/ -name "*.gif" -printf %f\\nfind: /home/huskeyw/.ssh: Permission deniedarrow.gifarrowd.gifbroken-image.gifgrabber.gifgopher-audio.gifgopher-binary.gifgopher-find.gifgopher-image.gifgopher-menu.gifgopher-movie.gifgopher-sound.gifgopher-telnet.gifgopher-text.gifgopher-unknown.gifloading-image.giftable-add-column-after-active.giftable-add-column-after-hover.giftable-add-column-after.giftable-add-column-before-active.giftable-add-column-before-hover.giftable-add-column-before.giftable-add-row-after-active.giftable-add-row-after-hover.giftable-add-row-after.giftable-add-row-before-active.giftable-add-row-before-hover.giftable-add-row-before.giftable-remove-column-active.giftable-remove-column-hover.giftable-remove-column.giftable-remove-row-active.giftable-remove-row-hover.giftable-remove-row.gifBlank Bkgrd.gifBtzhsepa.gifCitrus Punch Bkgrd.gifIvy.gifNetwork Blitz Bkgrd.gifSweets Bkgrd.gifaleabanr.gifamaizrul.gifanabnr2.gifaswrule.gifcitbannA.giffieruled.gifsunbannA.giftech.gifBlank Bkgrd.gifBtzhsepa.gifCitrus Punch Bkgrd.gifIvy.gifNetwork Blitz Bkgrd.gifSweets Bkgrd.gifaleabanr.gifamaizrul.gifanabnr2.gifaswrule.gifcitbannA.giffieruled.gifsunbannA.giftech.gif0000000001_000000000000000017246[1].gif0000000001_000000000000000151527[1].gif0408_004_A_728090_A_NTC_415[1].gif6CDE404B4BFEC334D023E5422081E0[1].gifGeneric_Missions_Site_Banners_MSCOM_180x150[1].gifaddrbook[1].gifclear1x1[1].gifcollapse[1].gifcopyto[1].gifdeleted[1].gifexclaim[1].gifexpandbutton-open[1].gificon-contact-dl[1].gificon-folder-tasks[1].gificon-journal[1].gificon-msg-forward[1].gificon-msg-signed-reply[1].gificon-msg-unread[1].gificon_ieaddons[1].gificon_support[1].gifimp-high[1].giflight[1].giflightbtm[1].giflogin-arrow[1].gifloginHeader[1].gifloginh1[1].giflogoff[1].giflogon_IE_top[1].gifmain-bg-trans[1].gifmsnbf[1].gifnb-hide-ql[1].gifnb-ql-tgl[1].gifnewemail[1].gifnewitem[1].gifnotes[1].gifosb[1].gifoutbox[1].gifpg-next[1].gifpipe[1].gifpor2_active_cap_lft[1].gifpor_active_cap_lft[1].gifpor_arrow[1].gifportlet-gray-right[1].gifportlet-left[1].gifpublic-fld[1].gifrefresh[1].gifsaic_link[1].gifsaic_link[2].gifsignin[1].gifsort-d[1].gifspacer[1].giftab_on_a[1].giftitlebar-button-minimize[1].giftitlebar-gray[1].gifvideo[1].gif32[1].gif5-1x1_tracking_pixel[1].gif9CC7E6CB6C74EE6769A6C8FDA33AB[1].gifKenD_CEO[1].gifbg_b[1].gifcalendar-lg[1].gifdark[1].gifdown-w[1].gifdumpster[1].giffolder-icon[1].giffolder-lg[1].gifglow_b[1].gificon-appt[1].gificon-folder-calendar[1].gificon-folder[1].gificon-msg-reply[1].gificon-msg-signed-read[1].gificon_ie7[1].gifie7_home_feature_bullet[1].gifinbox[1].gifissaic_header[1].gifissaic_logo[1].gifjunkemail[1].giflight[1].giflog-off[1].giflogo_microsoft[1].giflogon_IE_bot[1].giflogon_Microsoft[1].gifmoveto[1].gifoptions[1].gifpg-first[1].gifpor_active_bkg_span[1].gifpor_bkg_cap_lft[1].gifprev-bott[1].gifprimedns[1].gifresize-dot[1].gifsearch-box-issaic[1].gifsearch-box-people[1].gifsearch[1].gifsent-items[1].gifshow-hub-playerbg[1].gift[1].gift[2].giftab_on_b[1].giftask-lg[1].giftitlebar-right[1].gifview-document[1].gifview-flag[1].gif32E46DE281A68B9C33FC582D2569D[1].gif7CE57843948D6DF13E79A2DE4E15C[1].gif86F1396496DFE1BAD68AB5F28409[1].gifWL_b[1].gifbg[1].gifblank[1].gifblank[2].gifbtn_232x24[1].gifbullet[1].gifdark[1].gifdown-b[1].gifdrafts[1].gifedit-portlet-icon[1].gifemail[1].gifflg-empty[1].gificon-doc[1].gificon-folder-journal[1].gificon-msg-read[1].gificon-msg-signed-forward[1].gificon-msg-signed[1].gificon-mtgreq[1].gificon-post[1].gifjeffkoons[1].giflightbtm[1].giflogon_logo[1].gifmain-bg[1].gifmain-bg[2].gifmsft[1].gifmsn_b[1].gifmsx80019_main_180x150_ms[1].gifnb-bkgd[1].gifnb-show-ql[1].gifoptions-lg[1].gifpg-last[1].gifplus[1].gifpor2_active_cap_rt[1].gifpor_active_cap_rt[1].gifpor_bkg_cap_rt[1].gifportlet-gray-left[1].gifportlet-right[1].gifprev-off[1].gifprev-right[1].gifreplyall[1].gifrules[1].gifsearch[1].gifsr[1].giftitlebar-gray-right[1].giftitlebar[1].giftool-bkgd[1].gifview-importance[1].gifwindowsNGN_ltr[1].gif0000000033_000000000000000578669[2].gif26[1].gifIT_portlet_logo[1].gifarrow_green_rt[1].gifbtn_232x24_a[1].gifbuttons[1].gifclear[1].gifcontacts-lg[1].gifcwtv_nav[1].gifdelete[1].gifhelp[1].gificon-contact[1].gificon-folder-contacts[1].gificon-folder-notes[1].gificon-paperclip[1].gificon-task[1].gificon_community[1].gificon_quickref[1].gifissaic_footer[1].giflogo2[1].giflogo_windows[1].giflogo_windowslive[1].gifminus[1].gifnewfldr[1].gifnin-bg[1].gifpg-prev[1].gifplayerbg[1].gifpor2_active_bkg_span[1].gifpor_bkg[1].gifpor_bkg_divline[1].gifregister[1].gifreminder[1].gifroot[1].gifrules-lg[1].gifsaic_link[1].gifsaic_logo_footer[1].gifsaic_tnail[1].gifsaicatglance[1].gifsearch-box-capabilities[1].gifsearch-box-google[1].gifstatus-info[1].giftab_IE_off[1].giftimeline-slider[1].gifview-paperclip[1].gifYukon PM Schedule.gifYukon SE Schedule.gifYukon SI Schedule.gifYukon Schedule.gif071207_ST_Q4_C_300x250[1].gif234x60e[1].gifCAI7OB9M.gifCAOPQRAB.gifainw_000000[1].gifb_homepage[1].gifbh[1].gifbh[2].gifbins=1[1].gifblank[1].gifbtn_232x24[1].gifbullets[1].gifclear1x1[1].gifdown-b[1].gifdrafts[1].gifemail[1].gifflg-empty[1].giffolder-icon[1].gifhit[1].gifico_cpu[1].gificon-doc[1].gificon-msg-signed-forward[1].gificon-msg-signed[1].gificon-msg-unread[1].gificon-mtgreq[1].gificon-post[1].gifimgad[1].gifimp[1].gifjunkemail[1].gifjustify-r[1].giflogo_windowslive[1].giflogon_IE_top[1].gifmedia224440[1].gifnav-bg-over[1].gifnb-bkgd[1].gifnok[1].gifoptions-lg[1].gifpair_networks_20[1].gifpg-last[1].gifpg-prev[1].gifpixel_white[1].gifplaynowcars[1].gifplus[1].gifpor_active_cap_rt[1].gifpor_bkg_cap_rt[1].gifprev-off[1].gifprev-right[1].gifprio-low[1].gifrefresh[1].gifrules[1].gifsaicatglance[1].gifsearch-box-issaic[1].gifsearch-box-people[1].gifsharegamesbanner[1].gifspelling[1].gifsr[1].giftab_on_b[1].giftabby[1].gifthumb-shadow[1].giftit_gamesbyothers[1].giftit_partnersites[1].giftit_randomgames[1].giftit_siteinfo[1].giftit_topgames_blue[1].giftitlebar-gray-right[1].giftitlebar-right[1].giftool-font[1].giftool-spellprogress[1].giftop-story-bg-hover[1].giftt[1].gifvideo_link[1].gifview-importance[1].gifview-webpage[1].gif469554974[1].gifCA4TMZWD.gifCACPQ3KT.gifCAGBZNIG.gifIT_portlet_logo[1].gifRGST[1].gifarrow_yellow[1].gifarrowred[1].gifattach[1].gifb_topgames[1].gifback[1].gifblank[1].gifbtn_232x24_a[1].gifbullet_arrow_orange[1].gifbullnumb[1].gifcalendar-lg[1].gifchotz[1].gifclick[1].gifdown-w[1].gifheader-background[1].gifheadline-arrow[1].gifhr_gray[1].gifico_hdd[1].gificon-appt[1].gificon-folder[1].gificon-msg-read[1].gificon-msg-signed-read[1].gificon_community[1].gificon_quickref[1].gifinbox[1].gifissaic_header[1].gifissaic_logo[1].gifjustify-l[1].giflat_r[1].giflogon_logo[1].gifmoveto[1].gifnext[1].gifnin-bg[1].gifnotes[1].gifoptions[1].gifpgph-ltr[1].gifpor2_active_cap_lft[1].gifpor_active_cap_lft[1].gifpor_bkg[1].gifpor_bkg_divline[1].gifprev-bott[1].gifresize-dot[1].gifrss[1].gifsaic_link[1].gifsaic_link[2].gifsave[1].gifsearch[1].gifsent-items[1].gifstatus-info[1].giftab_on_a[1].giftask-lg[1].giftit_exclusivegames_blue[1].giftoms-hardware-logo[1].giftool-bkgd[1].giftop-story-bg-hover[1].gifview-document[1].gifview-flag[1].gif293042060[1].gifCA6P8RSB.gifCATO6D93.gifCAU7WLY5.gifKenD_CEO[1].gifSurfrider300x250_1[1].gifb_freesite[1].gifbanner609x65b[1].gifbluaro[1].gifborders[1].gifbullet_arrow[1].gifcap-right[1].gifcheckname[1].gifcheckout_000000[1].gifclear[1].gifconnect[1].gifcontacts-lg[1].gifcopyto[1].gifdelete[1].gifdumpster[1].gifedit-portlet-icon[1].gifexpandbutton-open[1].giffontcolor[1].gifhelp[1].gifhit[1].gifico_vga[1].gificon-contact[1].gificon-msg-reply[1].gificon-paperclip[1].gificon-task[1].gifimgad[1].gifissaic_footer[1].giflat_l[1].gifleft[1].giflogo2[1].giflogo[1].giflogo_windows[1].giflogon_IE_bot[1].gifminus[1].gifmsx80019_ware_180x150_ms_001[1].gifnav-bg[1].gifnb-show-ql[1].gifnewfldr[1].gifnewitem[1].gifoutdent[1].gifpgph-rtl[1].gifpixel[2].gifpor2_active_bkg_span[1].gifpor_active_bkg_span[1].gifpor_arrow[1].gifportlet-gray-left[1].gifportlet-left[1].gifprev[1].gifprint[1].gifreminder[1].gifright[1].gifroot[1].gifrules-lg[1].gifsaic_logo_footer[1].gifsearch-box-capabilities[1].gifsearch[1].giftit_gamesearch_green[1].giftit_newgames[1].giftop_ten_bar[1].gifview-paperclip[1].gif11[1].gif12009424321195222546-freegamepick-1-1[1].gifCA97VX0K.gifCAI70ZFS.gifCAOVALIH.gifCAU7GJNC.gifaddrbook[1].gifb_contact[1].gifb_home[1].gifb_submit_green[1].gifbh[1].gifbomg[1].gifcap-left[1].gifcollapse[1].gifconnect[1].gifdeleted[1].giffolder-lg[1].gifhr_wil_tnail[1].gificon-contact-dl[1].gificon-journal[1].gificon-msg-forward[1].gificon-msg-signed-reply[1].gificon_ie7[1].gificon_support[1].gifimp-high[1].gifindent[1].gifjustify-c[1].gifloginHeader[1].gifloginh1[1].giflogo_microsoft[1].giflogoff[1].giflogon_Microsoft[1].gifnb-hide-ql[1].gifnb-ql-tgl[1].gifnb-sel-bkgd[1].gifnewemail[1].gifoutbox[1].gifpg-first[1].gifpg-next[1].gifpixel_transp[1].gifpor2_active_cap_rt[1].gifpor_bkg_cap_lft[1].gifportlet-gray-right[1].gifportlet-right[1].gifprio-high[1].gifpublic-fld[1].gifreplyall[1].gifsaic_link[1].gifsearch-box-google[1].gifsearch-button[1].gifsend[1].gifsig[1].gifsort-d[1].gifspacer[1].gifstatus-info20[1].giftab_IE_off[1].giftit_gamecategories[1].giftit_top10games[1].giftitlebar-button-minimize[1].giftitlebar-gray[1].giftitlebar[1].giftop-story-bg[1].giftop-story-bg[2].gifwindowsNGN_ltr[1].gifx-click-but21[1].gifjitalert.giftips.gifjitalert.giftips.gifno_favicon.gifrss.gif16x16-digg-guy.gifblinklist.giffacebook.giffurl.gifnetscape.giftechnorati.giftumblr.gifarrow.gifarrowd.gifbroken-image.gifgrabber.gifgopher-audio.gifgopher-binary.gifgopher-find.gifgopher-image.gifgopher-menu.gifgopher-movie.gifgopher-sound.gifgopher-telnet.gifgopher-text.gifgopher-unknown.gifloading-image.giftable-add-column-after-active.giftable-add-column-after-hover.giftable-add-column-after.giftable-add-column-before-active.giftable-add-column-before-hover.giftable-add-column-before.giftable-add-row-after-active.giftable-add-row-after-hover.giftable-add-row-after.giftable-add-row-before-active.giftable-add-row-before-hover.giftable-add-row-before.giftable-remove-column-active.giftable-remove-column-hover.giftable-remove-column.giftable-remove-row-active.giftable-remove-row-hover.giftable-remove-row.gifEasternSierraPanorama.gifb.gifgbck.gifhb.giflogo.gifmainbck.gifsplash.giftopbck.gifarrow.gifarrowd.gifbroken-image.gifgrabber.gifgopher-audio.gifgopher-binary.gifgopher-find.gifgopher-image.gifgopher-menu.gifgopher-movie.gifgopher-sound.gifgopher-telnet.gifgopher-text.gifgopher-unknown.gifloading-image.giftable-add-column-after-active.giftable-add-column-after-hover.giftable-add-column-after.giftable-add-column-before-active.giftable-add-column-before-hover.giftable-add-column-before.giftable-add-row-after-active.giftable-add-row-after-hover.giftable-add-row-after.giftable-add-row-before-active.giftable-add-row-before-hover.giftable-add-row-before.giftable-remove-column-active.giftable-remove-column-hover.giftable-remove-column.giftable-remove-row-active.giftable-remove-row-hover.giftable-remove-row.gifsplash.gifSTAR.gifSTARlogo.gifEasternSierraPanorama-1.gifEasternSierraPanorama-2.gifsplash.gifsorry I have lots of gif files, but its a mass example now lets copy the gif files to a tmp folderhuskeyw@ubuntu-laptop:/tmp$ find /home/huskeyw/ -name "*.gif" -exec cp {} /tmp/find/ \;find: /home/huskeyw/.ssh: Permission deniednow lets look at what we gothuskeyw@ubuntu-laptop:/tmp$ cd /tmp/find/huskeyw@ubuntu-laptop:/tmp/find$ ls0000000001_000000000000000017246[1].gif0000000001_000000000000000151527[1].gif0000000033_000000000000000578669[2].gif0408_004_A_728090_A_NTC_415[1].gif071207_ST_Q4_C_300x250[1].gif11[1].gif12009424321195222546-freegamepick-1-1[1].gif16x16-digg-guy.gif234x60e[1].gif26[1].gif293042060[1].gif32[1].gif32E46DE281A68B9C33FC582D2569D[1].gif469554974[1].gif5-1x1_tracking_pixel[1].gif6CDE404B4BFEC334D023E5422081E0[1].gif7CE57843948D6DF13E79A2DE4E15C[1].gif86F1396496DFE1BAD68AB5F28409[1].gif9CC7E6CB6C74EE6769A6C8FDA33AB[1].gifaddrbook[1].gifainw_000000[1].gifaleabanr.gifamaizrul.gifanabnr2.gifarrowd.gifarrow.gifarrow_green_rt[1].gifarrowred[1].gifarrow_yellow[1].gifaswrule.gifattach[1].gifback[1].gifbanner609x65b[1].gifb_contact[1].gifb_freesite[1].gifbg[1].gifbg_b[1].gifb.gifbh[1].gifbh[2].gifb_home[1].gifb_homepage[1].gifbins=1[1].gifblank[1].gifblank[2].gifBlank Bkgrd.gifblinklist.gifbluaro[1].gifbomg[1].gifborders[1].gifbroken-image.gifb_submit_green[1].gifbtn_232x24[1].gifbtn_232x24_a[1].gifb_topgames[1].gifBtzhsepa.gifbullet[1].gifbullet_arrow[1].gifbullet_arrow_orange[1].gifbullets[1].gifbullnumb[1].gifbuttons[1].gifCA4TMZWD.gifCA6P8RSB.gifCA97VX0K.gifCACPQ3KT.gifCAGBZNIG.gifCAI70ZFS.gifCAI7OB9M.gifcalendar-lg[1].gifCAOPQRAB.gifCAOVALIH.gifcap-left[1].gifcap-right[1].gifCATO6D93.gifCAU7GJNC.gifCAU7WLY5.gifcheckname[1].gifcheckout_000000[1].gifchotz[1].gifcitbannA.gifCitrus Punch Bkgrd.gifclear[1].gifclear1x1[1].gifclick[1].gifcollapse[1].gifconnect[1].gifcontacts-lg[1].gifcopyto[1].gifcwtv_nav[1].gifdark[1].gifdelete[1].gifdeleted[1].gifdown-b[1].gifdown-w[1].gifdrafts[1].gifdumpster[1].gifEasternSierraPanorama-1.gifEasternSierraPanorama-2.gifEasternSierraPanorama.gifedit-portlet-icon[1].gifemail[1].gifexclaim[1].gifexpandbutton-open[1].giffacebook.giffieruled.gifflg-empty[1].giffolder-icon[1].giffolder-lg[1].giffontcolor[1].giffurl.gifgbck.gifGeneric_Missions_Site_Banners_MSCOM_180x150[1].gifglow_b[1].gifgopher-audio.gifgopher-binary.gifgopher-find.gifgopher-image.gifgopher-menu.gifgopher-movie.gifgopher-sound.gifgopher-telnet.gifgopher-text.gifgopher-unknown.gifgrabber.gifhb.gifheader-background[1].gifheadline-arrow[1].gifhelp[1].gifhit[1].gifhr_gray[1].gifhr_wil_tnail[1].gifico_cpu[1].gifico_hdd[1].gificon-appt[1].gificon_community[1].gificon-contact[1].gificon-contact-dl[1].gificon-doc[1].gificon-folder[1].gificon-folder-calendar[1].gificon-folder-contacts[1].gificon-folder-journal[1].gificon-folder-notes[1].gificon-folder-tasks[1].gificon_ie7[1].gificon_ieaddons[1].gificon-journal[1].gificon-msg-forward[1].gificon-msg-read[1].gificon-msg-reply[1].gificon-msg-signed[1].gificon-msg-signed-forward[1].gificon-msg-signed-read[1].gificon-msg-signed-reply[1].gificon-msg-unread[1].gificon-mtgreq[1].gificon-paperclip[1].gificon-post[1].gificon_quickref[1].gificon_support[1].gificon-task[1].gifico_vga[1].gifie7_home_feature_bullet[1].gifimgad[1].gifimp[1].gifimp-high[1].gifinbox[1].gifindent[1].gifissaic_footer[1].gifissaic_header[1].gifissaic_logo[1].gifIT_portlet_logo[1].gifIvy.gifjeffkoons[1].gifjitalert.gifjunkemail[1].gifjustify-c[1].gifjustify-l[1].gifjustify-r[1].gifKenD_CEO[1].giflat_l[1].giflat_r[1].gifleft[1].giflight[1].giflightbtm[1].gifloading-image.giflogin-arrow[1].gifloginh1[1].gifloginHeader[1].giflogo[1].giflogo2[1].giflog-off[1].giflogoff[1].giflogo.giflogo_microsoft[1].giflogon_IE_bot[1].giflogon_IE_top[1].giflogon_logo[1].giflogon_Microsoft[1].giflogo_windows[1].giflogo_windowslive[1].gifmainbck.gifmain-bg[1].gifmain-bg[2].gifmain-bg-trans[1].gifmedia224440[1].gifminus[1].gifmoveto[1].gifmsft[1].gifmsn_b[1].gifmsnbf[1].gifmsx80019_main_180x150_ms[1].gifmsx80019_ware_180x150_ms_001[1].gifnav-bg[1].gifnav-bg-over[1].gifnb-bkgd[1].gifnb-hide-ql[1].gifnb-ql-tgl[1].gifnb-sel-bkgd[1].gifnb-show-ql[1].gifnetscape.gifNetwork Blitz Bkgrd.gifnewemail[1].gifnewfldr[1].gifnewitem[1].gifnext[1].gifnin-bg[1].gifno_favicon.gifnok[1].gifnotes[1].gifoptions[1].gifoptions-lg[1].gifosb[1].gifoutbox[1].gifoutdent[1].gifpair_networks_20[1].gifpg-first[1].gifpg-last[1].gifpg-next[1].gifpgph-ltr[1].gifpgph-rtl[1].gifpg-prev[1].gifpipe[1].gifpixel[2].gifpixel_transp[1].gifpixel_white[1].gifplayerbg[1].gifplaynowcars[1].gifplus[1].gifpor2_active_bkg_span[1].gifpor2_active_cap_lft[1].gifpor2_active_cap_rt[1].gifpor_active_bkg_span[1].gifpor_active_cap_lft[1].gifpor_active_cap_rt[1].gifpor_arrow[1].gifpor_bkg[1].gifpor_bkg_cap_lft[1].gifpor_bkg_cap_rt[1].gifpor_bkg_divline[1].gifportlet-gray-left[1].gifportlet-gray-right[1].gifportlet-left[1].gifportlet-right[1].gifprev[1].gifprev-bott[1].gifprev-off[1].gifprev-right[1].gifprimedns[1].gifprint[1].gifprio-high[1].gifprio-low[1].gifpublic-fld[1].gifrefresh[1].gifregister[1].gifreminder[1].gifreplyall[1].gifresize-dot[1].gifRGST[1].gifright[1].gifroot[1].gifrss[1].gifrss.gifrules[1].gifrules-lg[1].gifsaicatglance[1].gifsaic_link[1].gifsaic_link[2].gifsaic_logo_footer[1].gifsaic_tnail[1].gifsave[1].gifsearch[1].gifsearch-box-capabilities[1].gifsearch-box-google[1].gifsearch-box-issaic[1].gifsearch-box-people[1].gifsearch-button[1].gifsend[1].gifsent-items[1].gifsharegamesbanner[1].gifshow-hub-playerbg[1].gifsig[1].gifsignin[1].gifsort-d[1].gifspacer[1].gifspelling[1].gifsplash.gifsr[1].gifSTAR.gifSTARlogo.gifstatus-info[1].gifstatus-info20[1].gifsunbannA.gifSurfrider300x250_1[1].gifSweets Bkgrd.gift[1].gift[2].giftabby[1].giftab_IE_off[1].giftable-add-column-after-active.giftable-add-column-after.giftable-add-column-after-hover.giftable-add-column-before-active.giftable-add-column-before.giftable-add-column-before-hover.giftable-add-row-after-active.giftable-add-row-after.giftable-add-row-after-hover.giftable-add-row-before-active.giftable-add-row-before.giftable-add-row-before-hover.giftable-remove-column-active.giftable-remove-column.giftable-remove-column-hover.giftable-remove-row-active.giftable-remove-row.giftable-remove-row-hover.giftab_on_a[1].giftab_on_b[1].giftask-lg[1].giftech.giftechnorati.gifthumb-shadow[1].giftimeline-slider[1].giftips.giftit_exclusivegames_blue[1].giftit_gamecategories[1].giftit_gamesbyothers[1].giftit_gamesearch_green[1].giftitlebar[1].giftitlebar-button-minimize[1].giftitlebar-gray[1].giftitlebar-gray-right[1].giftitlebar-right[1].giftit_newgames[1].giftit_partnersites[1].giftit_randomgames[1].giftit_siteinfo[1].giftit_top10games[1].giftit_topgames_blue[1].giftoms-hardware-logo[1].giftool-bkgd[1].giftool-font[1].giftool-spellprogress[1].giftopbck.giftop-story-bg[1].giftop-story-bg[2].giftop-story-bg-hover[1].giftop_ten_bar[1].giftt[1].giftumblr.gifvideo[1].gifvideo_link[1].gifview-document[1].gifview-flag[1].gifview-importance[1].gifview-paperclip[1].gifview-webpage[1].gifwindowsNGN_ltr[1].gifWL_b[1].gifx-click-but21[1].gifYukon PM Schedule.gifYukon Schedule.gifYukon SE Schedule.gifYukon SI Schedule.gifhuskeyw@ubuntu-laptop:/tmp/find$so I don't know what does not work, to copy all files from one place to another.. it does not keep diretory structure because we are not worring about that or else we would have to keep themnote that duplactes are not coped.. also once you ran this command you can use the --update for the copy command to only update the backup folder find /home/huskeyw/ -name "*.gif" -exec cp --update {} /tmp/find/ \;also we could be more useful and tar up the resultshuskeyw@ubuntu-laptop:/tmp/find$ lshuskeyw@ubuntu-laptop:/tmp/find$ huskeyw@ubuntu-laptop:/tmp/find$ find /home/huskeyw -name "*.gif" -print0 | xargs -0t tar --no-recursion -PSczf /tmp/find/gif.tgzhuskeyw@ubuntu-laptop:/tmp/find$ lsgif.tgzI skipped all the output from the find/ you will find this did keep all my directroy structue so it can be restoredafer doing a tar zxvf on gif.tgzI get huskeyw@ubuntu-laptop:/tmp/find$ lsgif.tgz homeand my whole structure is there.. Edited May 2, 2008 by iccaros Quote Link to post Share on other sites
jcl Posted May 3, 2008 Report Share Posted May 3, 2008 Oh, hey, tar. $ tar -c $SOURCE | tar -x --wildcards '*.mp3'Add other options as needed. Bonus: you can backup over a network by piping through netcat. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.