Re: command to mv files & folders to dir
>>>>> Mark Panen <mark.panen@gmail.com> writes:
>>>>> On Sun, Sep 25, 2011 at 12:43 AM, Tom Furie <tom@furie.org.uk> wrote:
>>>>> On Sat, Sep 24, 2011 at 05:00:47PM +0700, Ivan Shmakov wrote:
>>>>> Tom Furie <tom@furie.org.uk> writes:
>>>> What's wrong with 'mv /mnt/deer/* /mnt/deer/zebra'? Sure, it'll
>>>> complain about trying to move zebra to itself, but it works.
>>> The other catch is that it won't consider the filenames with a
>>> leading dot, such as ‘.bashrc’.
>> Well, true, but there was no mention of dot files in the original
>> problem.
Neither it was stated that there were no such files.
[…]
> yes only the files put in /mnt/deer on 22/09/2011 must be moved to
> there own folder, but looks like i will have to spend days doing this
> manually as zebra is 378 gb big and i copied some files from zebra to
> /mnt/deer using "cp" (my bad) and i don't have much room to play with
> now as i only have 197gb left in /mnt/deer and a lot of duplicate
> files in /mnt/deer and /mnt/deer/zebra
To find the duplicates, the command like the following could
have been used:
$ cd /mnt/deer/ \
&& find . -type f -not -wholename ./zebra/\* \
-exec cmp -- {} zebra/{} \; \
-print
While to remove them (after double-checking!), the final -print
can be replaced with:
-exec rm -v -- {} +
--
FSF associate member #7257
Reply to: