This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Webmaster forum > November 2006 > Damned Linux
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Matt Probert 2006-11-19, 7:55 pm |
| Damn Linux!
A simple shell command, I want to move several thousand files (about
14,000) from one directory to another.
Under Windows/Dos I can use copy *.* or move *.*
Under Linux mv *
BUT, Linux can only cope with a small number of files matching the
wildcard, so I have to batch it.
Now there's user-friendly NOT!
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
|
| In <45559fca.157832640@news.madasafish.com>,
www@probertencyclopaedia.com (Matt Probert) mentions:
>A simple shell command, I want to move several thousand files (about
>14,000) from one directory to another.
>
>Under Windows/Dos I can use copy *.* or move *.*
>
>Under Linux mv *
>
>BUT, Linux can only cope with a small number of files matching the
>wildcard, so I have to batch it.
Have a look at 'xargs' for overcomming the too many argument
problem.
Alternatively, for moving a lot of files:
Something like:
(cd /path/of/old ; tar cf - *) | tar xf -
To see what would have been copied, w/out actually copying them:
(cd /path/of/old ; tar cf - * ) | tar tf -
Kinda handy because you can do it across ssh as well.
But I do see what you're saying. I usually use 'midnight commander'
for moving files around, helps me keep my paths straight.
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
| |
| Baho Utot 2006-11-19, 7:55 pm |
| On Sat, 11 Nov 2006 10:05:58 +0000, Matt Probert wrote:
>
>
> Damn Linux!
>
> A simple shell command, I want to move several thousand files (about
> 14,000) from one directory to another.
>
> Under Windows/Dos I can use copy *.* or move *.*
>
> Under Linux mv *
>
> BUT, Linux can only cope with a small number of files matching the
> wildcard, so I have to batch it.
>
> Now there's user-friendly NOT!
>
> Matt
try rsync or tar.
--
Dancin' in the ruins tonight
Tayo'y Mga Pinoy
| |
| Matt Probert 2006-11-19, 7:55 pm |
| On Sat, 11 Nov 2006 11:45:29 GMT, Baho Utot <user@client.kumusta.org>
wrote:
>On Sat, 11 Nov 2006 10:05:58 +0000, Matt Probert wrote:
>
>
>try rsync or tar.
>
rsync may assist with the copy (the documentation is a nightmare to
fathom out, but I think at the basic level ift may be just rsync <src>
<dest> ) but what about executing a chmod on a large group of files?
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Matt Probert 2006-11-19, 7:56 pm |
| Oh ha ha ha!
I tried rsync. It has exactly the same issues. "argument list too
long", which I guess really means that the shell can not cope with the
number of file names being matched by the wildcard.
Yeah I can work around this, I am familiar with tar, but that's not
the point. The point is that once again Linux proves itself to be an
unfriendly operating system.
At this rate I may have to pay more and use a Windows server, it might
be cheaper in the long term (time is money in business).
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Matt Probert 2006-11-19, 7:56 pm |
| On Sat, 11 Nov 2006 11:38:03 GMT, nospam@geniegate.com (Jamie) wrote:
>In <45559fca.157832640@news.madasafish.com>,
>www@probertencyclopaedia.com (Matt Probert) mentions:
>
>Have a look at 'xargs' for overcomming the too many argument
>problem.
Nice try:
bash: /usr/bin/xargs: Argument list too long
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Brian Wakem 2006-11-19, 7:56 pm |
| Matt Probert wrote:
> On Sat, 11 Nov 2006 11:38:03 GMT, nospam@geniegate.com (Jamie) wrote:
>
>
>
> Nice try:
>
> bash: /usr/bin/xargs: Argument list too long
This will work but it ain't quick (about 250 files/second on my desktop).
$ ls test/ | PERL -ne 'chomp;`mv test/$_ test2/`'
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
| |
| George L. Sexton 2006-11-19, 7:56 pm |
| On Sat, 11 Nov 2006 10:05:58 +0000, Matt Probert wrote:
> Damn Linux!
>
> A simple shell command, I want to move several thousand files (about
> 14,000) from one directory to another.
>
> Under Windows/Dos I can use copy *.* or move *.*
>
> Under Linux mv *
>
> BUT, Linux can only cope with a small number of files matching the
> wildcard, so I have to batch it.
find . -type f -name "your_wildcard.*" -exec mv "{}" /destinationpath \;
you can replace "-name" with "-iname" for a case insensitive match.
Linux isn't easy, but it is powerful.
--
George Sexton
MH Software, Inc. - Home of Connect Daily Web Calendar
http://www.mhsoftware.com/connectdaily.htm
| |
| Baho Utot 2006-11-19, 7:56 pm |
| On Sat, 11 Nov 2006 13:47:37 +0000, Matt Probert wrote:
>
>
> On Sat, 11 Nov 2006 11:45:29 GMT, Baho Utot <user@client.kumusta.org>
> wrote:
>
>
> rsync may assist with the copy (the documentation is a nightmare to
> fathom out, but I think at the basic level ift may be just rsync <src>
> <dest> ) but what about executing a chmod on a large group of files?
>
> Matt
rsync -av <src> <dest>
Why is the need to chmod the files?
--
Dancin' in the ruins tonight
Tayo'y Mga Pinoy
| |
|
| In <4555d5a1.13355937@news.madasafish.com>,
www@probertencyclopaedia.com (Matt Probert) mentions:
>Oh ha ha ha!
>
>I tried rsync. It has exactly the same issues. "argument list too
>long", which I guess really means that the shell can not cope with the
>number of file names being matched by the wildcard.
>
>Yeah I can work around this, I am familiar with tar, but that's not
>the point. The point is that once again Linux proves itself to be an
>unfriendly operating system.
What you are talking about has actually been listed in the "unix haters handbook"
the fact that the shell expands the arguments before the program sees it leads
to all manner of confusion.
It is a glitch, handy other times though. It's why you have
to quote stuff for the 'find' utility.
The upshot of all this is, you need to find a way of getting the arguments
into 'mv' in such a way the shell isn't (as) involved in expanding the
wildcards. You could probably do it with a combination of 'find' and
xargs. (been a LONG time since I've had the problem you are talking
about so I'm a bit rusty on the usage of xargs, except that it was
designed to overcome this problem) Something to do with piping the
output of find into xargs, where xargs can run repeated invocations
of the command.
Windows has it's problems too.
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
| |
| Matt Probert 2006-11-19, 7:56 pm |
| On Sat, 11 Nov 2006 14:22:37 +0000, Brian Wakem <no@email.com> wrote:
>Matt Probert wrote:
>
>
>
>This will work but it ain't quick (about 250 files/second on my desktop).
>
>$ ls test/ | PERL -ne 'chomp;`mv test/$_ test2/`'
>
Are we going to have a contest for the most convoluted, least
intuitive, least user friendly work around for Linux inability to deal
with a long list of file names ?
<g>
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Matt Probert 2006-11-19, 7:56 pm |
| On Sat, 11 Nov 2006 08:05:37 -0700, "George L. Sexton"
<gsexton@reddwarf.private.mhsoftware.com> wrote:
>On Sat, 11 Nov 2006 10:05:58 +0000, Matt Probert wrote:
>
>
>find . -type f -name "your_wildcard.*" -exec mv "{}" /destinationpath \;
>
>you can replace "-name" with "-iname" for a case insensitive match.
>
>Linux isn't easy, but it is powerful.
>
I'm in business. I don't have time for this nonsense. C is powerful,
but I'm not about to spend an hour writing a C program to do the job I
can do with a few characters under DOS!
Linux may be powerful, but it's not a business tool.
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Brian Wakem 2006-11-19, 7:57 pm |
| Matt Probert wrote:
> On Sat, 11 Nov 2006 14:22:37 +0000, Brian Wakem <no@email.com> wrote:
>
>
> Are we going to have a contest for the most convoluted, least
> intuitive, least user friendly work around for Linux inability to deal
> with a long list of file names ?
>
> <g>
>
> Matt
Why not!
BTW, how many files were you trying to move?
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
| |
| John Bokma 2006-11-19, 7:57 pm |
| www@probertencyclopaedia.com (Matt Probert) wrote:
> Linux may be powerful, but it's not a business tool.
I am glad that's an opinion, not a fact :-D.
--
John Need help with SEO? Get started with a SEO report of your site:
--> http://johnbokma.com/websitedesign/seo-expert-help.html
| |
| William Tasso 2006-11-19, 7:57 pm |
| Fleeing from the madness of the The Probert Encyclopaedia jungle
Matt Probert <www@probertencyclopaedia.com> stumbled into
news:alt.www.webmaster
and said:
> ...
> Are we going to have a contest
Only if the prize is worth fighting for.
--
William Tasso
http://williamtasso.com/words/what-is-usenet.asp
| |
| Baho Utot 2006-11-19, 7:57 pm |
| On Sat, 11 Nov 2006 17:34:27 +0000, Matt Probert wrote:
>
>
> On Sat, 11 Nov 2006 08:05:37 -0700, "George L. Sexton"
> <gsexton@reddwarf.private.mhsoftware.com> wrote:
>
>
> I'm in business. I don't have time for this nonsense. C is powerful,
> but I'm not about to spend an hour writing a C program to do the job I
> can do with a few characters under DOS!
>
> Linux may be powerful, but it's not a business tool.
>
> Matt
Neither is ms windows, but windows isn't powerful nor reliable or secure.
http://blogs.zdnet.com/open-source/?p=837
--
Dancin' in the ruins tonight
Tayo'y Mga Pinoy
| |
|
| On Sat, 11 Nov 2006 20:02:48 -0000, "William Tasso"
<SpamBlocked@tbdata.com> scrawled:
> Fleeing from the madness of the The Probert Encyclopaedia jungle
> Matt Probert <www@probertencyclopaedia.com> stumbled into
> news:alt.www.webmaster
> and said:
>
>
> Only if the prize is worth fighting for.
I wore a new pin yesterday - it's a penguin on ice skates. My son
took one look at it and asked "why do you have a skating Linux?"
--
MGW
Statistics means never having to say you're certain.
(Note: my Hotmail address is seldom checked)
| |
| William Tasso 2006-11-19, 7:57 pm |
| Fleeing from the madness of the jungle
MGW <mgw1979@hotmail.com> stumbled into news:alt.www.webmaster
and said:
> On Sat, 11 Nov 2006 20:02:48 -0000, "William Tasso"
> <SpamBlocked@tbdata.com> scrawled:
>
>
> I wore a new pin yesterday
I wore a red poppy today. Just today, not yesterday and not tommorow
(although I would if I were attending any rememberence ceremon[y|ies]).
> it's a penguin on ice skates. My son
> took one look at it and asked "why do you have a skating Linux?"
indeed - one is prompted to wonder <g>
--
William Tasso
http://williamtasso.com/words/what-is-usenet.asp
| |
| George L. Sexton 2006-11-19, 7:57 pm |
| On Sat, 11 Nov 2006 17:34:27 +0000, Matt Probert wrote:
> On Sat, 11 Nov 2006 08:05:37 -0700, "George L. Sexton"
> <gsexton@reddwarf.private.mhsoftware.com> wrote:
>
>
> I'm in business. I don't have time for this nonsense. C is powerful,
> but I'm not about to spend an hour writing a C program to do the job I
> can do with a few characters under DOS!
>
> Linux may be powerful, but it's not a business tool.
Are you just too rude or too stupid to thank someone for helping you?
--
George Sexton
MH Software, Inc. - Home of Connect Daily Web Calendar
http://www.mhsoftware.com/connectdaily.htm
| |
| Matt Probert 2006-11-19, 7:57 pm |
| On Sat, 11 Nov 2006 15:08:56 -0700, "George L. Sexton"
<gsexton@reddwarf.private.mhsoftware.com> wrote:
>On Sat, 11 Nov 2006 17:34:27 +0000, Matt Probert wrote:
>
>
>Are you just too rude or too stupid to thank someone for helping you?
>
Who wants help?
I didn't ask for help. I simply stated that Linux is about as friendly
as a starved rotteweiler.
I have worked with producing computerised solutions for people for
over 20 years. I don't need some jumped up sociopath with no life to
tell me I should spend hours learning how to use a crap operating
system. Computers are tools to those of us in business, not a means to
rip off the gullible and naive.
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Matt Probert 2006-11-19, 7:57 pm |
| On Sat, 11 Nov 2006 17:59:57 +0000, Brian Wakem <no@email.com> wrote:
>Matt Probert wrote:
>
>
>
>Why not!
>
>BTW, how many files were you trying to move?
>
About 14,000
From one directory to another. As I say, I can do it. I just find
Linux inability to do so in one command (mv) staggering.
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
| Karl Groves 2006-11-19, 7:57 pm |
| www@probertencyclopaedia.com (Matt Probert) wrote in
news:4556560e.46228859@news.madasafish.com:
>
> I didn't ask for help. I simply stated that Linux is about as friendly
> as a starved rotteweiler.
>
Please stop libeling Rottweilers.
Thanks.
--
Karl Groves
www.karlcore.com
| |
| William Tasso 2006-11-19, 7:57 pm |
| Fleeing from the madness of the The Probert Encyclopaedia jungle
Matt Probert <www@probertencyclopaedia.com> stumbled into
news:alt.www.webmaster
and said:
> ...
> Computers are tools to those of us in business, not a means to
> rip off the gullible and naive.
You've never worked for IBM have you?
--
William Tasso
http://williamtasso.com/words/what-is-usenet.asp
| |
| Blinky the Shark 2006-11-19, 7:57 pm |
| George L. Sexton wrote:
> On Sat, 11 Nov 2006 17:34:27 +0000, Matt Probert wrote:
>
>
> Are you just too rude or too stupid to thank someone for helping you?
I think you'll find that the two aren't mutually exclusive; I'd be
willing to bet that they're *often* found working hand in hand.
--
Blinky RLU 297263
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
| |
| Chris Hope 2006-11-19, 7:57 pm |
| Matt Probert wrote:
> Damn Linux!
>
> A simple shell command, I want to move several thousand files (about
> 14,000) from one directory to another.
>
> Under Windows/Dos I can use copy *.* or move *.*
>
> Under Linux mv *
>
> BUT, Linux can only cope with a small number of files matching the
> wildcard, so I have to batch it.
>
> Now there's user-friendly NOT!
I've come across this issue myself before and thought it was a pain in
the butt, but 14,000 didn't seem like all that many to be causing
issues to me. I'm fairly certain I've only ever had issues when there
were 100,000s of files.
I just done a test on my desktop machine (Gentoo Linux) and create
14,000 files and then mv * them into a different directory and it
worked fine. Out of interest, which Linux distro and version are you
using?
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
| |
| Brian Wakem 2006-11-19, 7:57 pm |
| Matt Probert wrote:
> On Sat, 11 Nov 2006 17:59:57 +0000, Brian Wakem <no@email.com> wrote:
>
>
> About 14,000
>
> From one directory to another. As I say, I can do it. I just find
> Linux inability to do so in one command (mv) staggering.
I've no idea what the limit is, but FWIW I can move 14k files with mv.
$ ls | wc -l
14000
$ mkdir ../test2
$ mv ./* ../test2/
$ ls | wc -l
0
$ ls ../test2 | wc -l
14000
$
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
| |
| Charles Sweeney 2006-11-19, 7:57 pm |
| Matt Probert wrote
> Yeah I can work around this, I am familiar with tar, but that's not
> the point. The point is that once again Linux proves itself to be an
> unfriendly operating system.
It does seem staggering, as you say. What about Brian's solution? Looks
quite straight-forward.
--
Charles Sweeney
http://CharlesSweeney.com
| |
| Charles Sweeney 2006-11-19, 7:57 pm |
| Matt Probert wrote
> Linux may be powerful, but it's not a business tool.
Maybe that's why it's free?
--
Charles Sweeney
http://CharlesSweeney.com
| |
|
|
|
| In <Xns987972EAD4092mecharlessweeneycom@130.133.1.4>,
Charles Sweeney <me@charlessweeney.com> mentions:
>Matt Probert wrote
>
>
>Maybe that's why it's free?
Free means he's free to examine the source of the 'mv' command and fix
the problem if he chooses. That in my opinion, is why "free" is actually
an asset. (Course in the above case, it'd be easier to just work around it)
In the case of the OP, I would recommend a commercial flavor of unix. Maybe
apple or something where he can point, click and have some company to blame for
his woes instead of blaming the Open Source developers who bothered to
implement nice software for him to make money with.
In the wonderful world of non-free, you might be able to move a lot of files,
but you've no real control over how they get moved. Doesn't seem like a problem
until you want to run the same software on another OS or modify something to
suit your own particular needs.
I'm amazed at how I can run the same software on DragonflyBSD, Linux AND a mac.
That to me is freedom. It's great.
I do wish Open Source developers would start charging for their GPL'd work,
it's about time they did that. Charging for GPL'd work would send a message to
people that "free" is actually worth something. People can chant, shout and
repeat "It's not about the money!" all the want, but charging is the only
way people will realize freedom has value.
Doesn't mean one couldn't buy a copy and then give that away for
free-as-in-cost, if they wanted. Or buy one copy and share it w/out all those
licenses, pool resources together for a copy and share among friends, whatever.
Of course, this will never happen. :-/
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
| |
| Matt Probert 2006-11-19, 7:58 pm |
| On Sun, 12 Nov 2006 21:23:02 +1300, Chris Hope
<blackhole@electrictoolbox.com> wrote:
>Matt Probert wrote:
>
>
>I've come across this issue myself before and thought it was a pain in
>the butt, but 14,000 didn't seem like all that many to be causing
>issues to me. I'm fairly certain I've only ever had issues when there
>were 100,000s of files.
>
>I just done a test on my desktop machine (Gentoo Linux) and create
>14,000 files and then mv * them into a different directory and it
>worked fine. Out of interest, which Linux distro and version are you
>using?
>
This issue has occurred on a "standard" Cobalt Raq 4 setup - which is
Cobalt Linux Release 6 Kernel 2.2.16C33_III
Matt
--
Woe to him that willfully innovates, while ignorant of the constant.
http://www.probertencyclopaedia.com
| |
|
|
| Cynode 2006-11-19, 7:58 pm |
| On Sat, 11 Nov 2006 10:05:58 GMT, www@probertencyclopaedia.com (Matt
Probert) wrote:
>Damn Linux!
>Now there's user-friendly NOT!
years and years ago I played with linux, and removed it after about 2
hours =)
friday I got the idea to try it again on my 2nd PC that just sits here
as a file server really.
I tried installing slackware 11 about 4 times with a different problem
each time, I finally got it installed, booted into x windows and only
half the stuff worked! my network card didnt work, sound card, video
card only worked on low settings, etc!!
So I decided to go with an easier distro, Mandriva. so far so good,
but it's only been since this morning so not really sure what I'm
doing yet (example, I can access my WinXP shared folder via Linux, but
I can't access my Linuxc shared folder from XP)
I also was trying to dual boot and screwed up my win2k install
somehow, now it just reboots itself when I try to boot into windows!
=)
anyways thats my user (not) friendly story for the day lol.
--
If it keeps up, man will atrophy all his limbs but the push-button finger.
~Frank Lloyd Wright - www.cynode.com | www.cynode.net (NWS)
| |
| Joe (GKF) 2006-11-19, 7:58 pm |
| In article <ladfl2hnsf372laiuqpdrrsa3mk7tamnmu@4ax.com>,
admin@cynode.com says...
> On Sat, 11 Nov 2006 10:05:58 GMT, www@probertencyclopaedia.com (Matt
> Probert) wrote:
>
>
> years and years ago I played with linux, and removed it after about 2
> hours =)
>
> friday I got the idea to try it again on my 2nd PC that just sits here
> as a file server really.
>
> I tried installing slackware 11 about 4 times with a different problem
> each time, I finally got it installed, booted into x windows and only
> half the stuff worked! my network card didnt work, sound card, video
> card only worked on low settings, etc!!
>
> So I decided to go with an easier distro, Mandriva. so far so good,
> but it's only been since this morning so not really sure what I'm
> doing yet (example, I can access my WinXP shared folder via Linux, but
> I can't access my Linuxc shared folder from XP)
>
> I also was trying to dual boot and screwed up my win2k install
> somehow, now it just reboots itself when I try to boot into windows!
> =)
>
> anyways thats my user (not) friendly story for the day lol.
>
>
FWIW, I have installed Ubuntu Linux on three different Win-boxes. Each
time it has gone without incident and everything has 'just worked'
straight away. It took about 30-45 minutes each time.
It was certainly a *lot* easier than doing a clean install of Windows
plus applications, which I have also done a few times.
--
Please visit -
Water saving tips: http://graspages.cjb.cc/bigdry/
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|