|
Prev: www.crazysupplier.com cheap nike shoes nike air jordans Manufacturer, Buyer, Supplier ...
Next: spliting a string.
From: franzi on 6 Apr 2008 11:24 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 6 Apr 2008 11:44 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 6 Apr 2008 12:33 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 6 Apr 2008 13:05 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 6 Apr 2008 22:57
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 |