[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: command to mv files & folders to dir



>>>>> Mark Panen <mark.panen@gmail.com> writes:

 > Made a bit off a muck up off things when i backed up parts of my
 > /home/mark directory to /mnt/deer

 > In /mnt/deer i know have hundreds of files and folders which i
 > rsynced on 22/09/2011.

 > I need a command line option to put them all In one shot in
 > /mnt/deer/zebra.

	It's not what I'd usually call “one shot” (= atomic), but, IIUC,
	the following single command line should do it:

$ mkdir -pv -- /mnt/deer/zebra \
      && find /mnt/deer/ -maxdepth 1 -mindepth 1 -not -name zebra \
             -exec mv --target-directory=/mnt/deer/zebra -- {} + 

-- 
FSF associate member #7257	Join news:comp.unix.shell for pretty
much /everything/ related to the POSIX Shell language and its variants.


Reply to: