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

Re: command to mv files & folders to dir



On Sat, Sep 24, 2011 at 11:53 AM, Ivan Shmakov <ivan@gray.siamics.net> wrote:
>>>>>> 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.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 86sjnmjmfy.fsf@gray.siamics.net">http://lists.debian.org/[🔎] 86sjnmjmfy.fsf@gray.siamics.net
>
>

will this mv only the file/folders created on the 22/09/2011, i want
the older files etc to stay behind.


Reply to: