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

Re: command to mv files & folders to dir



Hi,

On Sat, Sep 24, 2011 at 05:31:47PM +0700, Ivan Shmakov wrote:
> >>>>> Camaleón  <noelamac@gmail.com> writes:
> >>>>> On Sat, 24 Sep 2011 11:40:48 +0200, Mark Panen wrote:
> 
>  >> 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.
> 
>  > Not a command line but Midnight Commander is very good for such
>  > day-to- day tasks.
> 
> 	Following the suggestion of Victor Wagner (in
> 	news:fido7.ru.unix.linux, I believe), I've dropped
> 	Midnight Commander in favor of Bash something like a decade ago.
> 
> 	I've never regret the change.
> 
> 	Midnight Commander may simplify the simple things, but
> 	whatever's your experience with it, the complex tasks are often
> 	impossible.  

??? It is possible but repeating it is a bit of hussle.

> On the contrary, Shell lets one to benefit from the
> 	experience, and the solutions to the simpler tasks could usually
> 	be re-used to solve the more complex ones.

But task described does not seem to be much of repeat action. MC can do
this by:
 * Open old and new directory in each panel.
 * Mark all directory then unmark new directory in the old directory panel
 * press F6
==> DONE!

> 	Not to mention that the use of Shell keeps one's mind “in
> 	shape.”

Hmmm...

MC is good for interactive complex task while shell command with find
command is good for repeated complex task.  Many shell scripts tends
to become very complex which requires too much time for debugging.

When there is some exclusion rule etc., most commands with rsync etc.
becomes nealy impossible to debug for people like me.

Anyway, here are typical tricks used to copy files.

  http://www.debian.org/doc/manuals/debian-reference/ch10.en.html#_idioms_for_the_copy

If you combine this with find as described in the following link, it can
really do any complicated selection and copy.

  http://www.debian.org/doc/manuals/debian-reference/ch10.en.html#_idioms_for_the_selection_of_files

This is good if you are making backup script for regular backups.  It
can be told to pick file by date or size....  Or you can create target
directory name automatically by date.  That is when you need such shell
script.

(I would not bother doing this just for simple task like what you
described.  If you configure MC to display hidden files, it is very
powerful.)

Regards,

Osamu


Reply to: