From: franzi on
hi there ,is there a way more efficient and fast to mv many files from
one folder to anothere one
without writing all source to the target i.e
$ mv /home/*.avi /root/dirx/ && /home/*.txt /root/dirx etc
maybe with awk?
From: Johann Kappacher on
franzi wrote:
> hi there ,is there a way more efficient and fast to mv many files from
> one folder to anothere one
> without writing all source to the target i.e
> $ mv /home/*.avi /root/dirx/ && /home/*.txt /root/dirx etc
> maybe with awk?

Hi, this is not a well-formed question, it is very confusing!

One hint: If source and target are inside the same filesystem, the
mv is like using rename. Thus, it is very fast.

But you cannot move files without specifying a source and a target.
A strange question, isn't it?

--jk
From: Johann Kappacher on
Cyrus Kriticos wrote:
> cd /home && mv *.avi *.txt *.foo *.bar /root/dirx

Nice try, Cyrus, but I bet that Franzi wants to avoid "write source to
target" operations, i.e. file copy operations.

If /home and /root/dirx belong to the same filesystem, then
you can use mv and it will just rename the files without writing or
copying them.

I bet 10 MMD (Mickey Mouse Dollars) :-)
From: pk on
franzi wrote:

> hi there ,is there a way more efficient and fast to mv many files from
> one folder to anothere one
> without writing all source to the target i.e
> $ mv /home/*.avi /root/dirx/ && /home/*.txt /root/dirx etc

I think you are missing a "mv" after && in the command above.

My take is: you want to move all avi, txt,...etc. files from /home
to /root/dirx without having to type two or more commands, each with source
and destination.

If I got that right, try this:

$ mv /home/*.avi /home/*.txt /home/*.jpg /home/*.odt /root/dirx

or, with bash and maybe some other shell

$ mv /home/*.{avi,txt,jpg,odt} /root/dirx

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
From: franzi on
On 6 Apr, 19:05, pk <p...(a)pk.invalid> wrote:
> franzi wrote:
> > hi there ,is there a way more efficient and fast to mv many files from
> > one folder to anothere one
> > without writing all source to the target i.e
> > $ mv /home/*.avi /root/dirx/ && /home/*.txt /root/dirx etc
>
> I think you are missing a "mv" after && in the command above.
>
> My take is: you want to move all avi, txt,...etc. files from /home
> to /root/dirx without having to type two or more commands, each with source
> and destination.
>
> If I got that right, try this:
>
> $ mv /home/*.avi /home/*.txt /home/*.jpg /home/*.odt /root/dirx
>
> or, with bash and maybe some other shell
>
> $ mv /home/*.{avi,txt,jpg,odt} /root/dirx
>
> --
> All the commands are tested with bash and GNU tools, so they may use
> nonstandard features. I try to mention when something is nonstandard (if
> I'm aware of that), but I may miss something. Corrections are welcome.

ook guys you answerd right to me thanks very much