Re: 'rm' Can not delete files

2012-02-13 Thread Karl Vogel
On Fri, 10 Feb 2012 10:34:20 -0500, Henry Olyer henry.ol...@gmail.com said: H I never learned a shell language. I suppose no one is as dumb as H someone who choose's not to learn, so, what's the right one. csh? Not for scripting: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

Re: 'rm' Can not delete files

2012-02-11 Thread perryh
Jerry McAllister jerr...@msu.edu wrote: On Fri, Feb 10, 2012 at 10:34:20AM -0500, Henry Olyer wrote: I use bash 4. OK. So?? If you had read the thread before posting, you would have known that someone asked which shell Henry was using (and he answered).

Re: 'rm' Can not delete files

2012-02-11 Thread perryh
Matthew Seaman freebsd-questi...@infracaninophile.co.uk wrote: ls -1 | xargs rm but be aware that that wont work for filenames with spaces. True. Can't do that using ls to generate the list of filenames as there is no option to generate a null-separated list amongst ls's multitudinous

Re: 'rm' Can not delete files

2012-02-11 Thread Matthew Seaman
On 11/02/2012 15:33, per...@pluto.rain.com wrote: Matthew Seaman freebsd-questi...@infracaninophile.co.uk wrote: ls -1 | xargs rm but be aware that that wont work for filenames with spaces. True. Can't do that using ls to generate the list of filenames as there is no option to generate a

Re: 'rm' Can not delete files

2012-02-11 Thread RW
On Sat, 11 Feb 2012 12:05:14 +1100 andrew clarke wrote: On Fri 2012-02-10 16:12:06 UTC+, Matthew Seaman (m.sea...@infracaninophile.co.uk) wrote: In addition, I don't believe it solves the OP's initial problem of the argument list being too long! You'd probably need to use the

Re: 'rm' Can not delete files

2012-02-11 Thread Daniel Staal
--As of February 10, 2012 4:24:58 PM +, Matthew Seaman is alleged to have said: On 10/02/2012 16:04, Matthew Story wrote: find . -type f -depth 1 -print0 | xargs -n99 -0 -s8192 -c5 rm -- or some such, depending on your needs, I believe in most situations this particular invocation will

Re: 'rm' Can not delete files

2012-02-10 Thread Henry Olyer
So what do I change if I want to increase the shell's file limit? I use bash 4. And by the way, for me, part of the normal installation of a new FBSD box is to make certain changes. For example, for uniq -c I use %06 instead of %d because this way I can sort the output. Things like that. I

Re: 'rm' Can not delete files

2012-02-10 Thread Da Rock
On 02/11/12 01:34, Henry Olyer wrote: So what do I change if I want to increase the shell's file limit? I don't think you can. It's not a shell limit. It's a limit to the number of arguments the command itself will take. As said, the shell expands '*' to a list of files as the argument, and rm

Re: 'rm' Can not delete files

2012-02-10 Thread Matthew Story
On Fri, Feb 10, 2012 at 10:51 AM, Da Rock freebsd-questi...@herveybayaustralia.com.au wrote: On 02/11/12 01:34, Henry Olyer wrote: So what do I change if I want to increase the shell's file limit? I don't think you can. It's not a shell limit. It's a limit to the number of arguments the

Re: 'rm' Can not delete files

2012-02-10 Thread Matthew Story
On Fri, Feb 10, 2012 at 11:04 AM, Matthew Story matthewst...@gmail.comwrote: On Fri, Feb 10, 2012 at 10:51 AM, Da Rock freebsd-questi...@herveybayaustralia.com.au wrote: On 02/11/12 01:34, Henry Olyer wrote: So what do I change if I want to increase the shell's file limit? I don't think

Re: 'rm' Can not delete files

2012-02-10 Thread Matthew Seaman
ls -1 | xargs rm but be aware that that wont work for filenames with spaces. True. Can't do that using ls to generate the list of filenames as there is no option to generate a null-separated list amongst ls's multitudinous collection. In addition, I don't believe it solves the OP's initial

Re: 'rm' Can not delete files

2012-02-10 Thread Jerry McAllister
On Fri, Feb 10, 2012 at 10:34:20AM -0500, Henry Olyer wrote: So what do I change if I want to increase the shell's file limit? You don't want to diddle the shell. Use the correct UNIX utilities such as - for, xargs or find - in this case as have been suggested by other responders. That is

Re: 'rm' Can not delete files

2012-02-10 Thread Matthew Seaman
On 10/02/2012 16:04, Matthew Story wrote: find . -type f -depth 1 -print0 | xargs -n99 -0 -s8192 -c5 rm -- or some such, depending on your needs, I believe in most situations this particular invocation will also out-perform find ... -delete. Why would you believe that? find ... -delete calls

Re: 'rm' Can not delete files

2012-02-10 Thread Randal L. Schwartz
Matthew == Matthew Seaman m.sea...@infracaninophile.co.uk writes: Matthewfind . -type f -depth 1 -exec rm -f '{}' ';' Matthew but let's not leave people in any doubt that this is not the Matthew best option. However... find . -type f -depth 1 -exec rm -f {} + Might very well be a great

Re: 'rm' Can not delete files

2012-02-10 Thread andrew clarke
On Fri 2012-02-10 16:12:06 UTC+, Matthew Seaman (m.sea...@infracaninophile.co.uk) wrote: In addition, I don't believe it solves the OP's initial problem of the argument list being too long! You'd probably need to use the xargs -n switch here. Go and read the xargs(1) man page

Re: 'rm' Can not delete files

2012-02-08 Thread David Brodbeck
2012/2/7 Ingo Hofmann ingo.hofm...@dont-panic.org: What helps me sometimes is wrapping it up: for i in *; do rm $i; done Won't that just expand the * and result in the same problem? It seems like you've just moved the problem from the rm statement to the for statement.

Re: 'rm' Can not delete files

2012-02-08 Thread CyberLeo Kitsana
On 02/08/2012 12:02 PM, David Brodbeck wrote: 2012/2/7 Ingo Hofmann ingo.hofm...@dont-panic.org: What helps me sometimes is wrapping it up: for i in *; do rm $i; done Won't that just expand the * and result in the same problem? It seems like you've just moved the problem from the rm

Re: 'rm' Can not delete files

2012-02-08 Thread Robert Huff
David Brodbeck writes: What helps me sometimes is wrapping it up: for i in *; do rm $i; done Won't that just expand the * and result in the same problem? It seems like you've just moved the problem from the rm statement to the for statement. If the problem is the

Re: 'rm' Can not delete files

2012-02-08 Thread andrew clarke
On Tue 2012-02-07 23:17:16 UTC+, RW (rwmailli...@googlemail.com) wrote: On Tue, 07 Feb 2012 22:14:56 + Matthew Seaman wrote: ls -1 | xargs rm but be aware that that wont work for filenames with spaces. In addition, I don't believe it solves the OP's initial problem of the

Re: 'rm' Can not delete files

2012-02-07 Thread Randal L. Schwartz
Коньков == Коньков Евгений kes-...@yandex.ru writes: Коньков # rm * Коньков /bin/rm: Argument list too long. Коньков in this directory about 25000 files, Коньков but actually there is only one argument to rm it is '*' sign. Коньков Why rm get list of all files in directore instead of deleting

Re: 'rm' Can not delete files

2012-02-07 Thread Rares Aioanei
On 02/07/2012 11:59 PM, Коньков Евгений wrote: # rm * /bin/rm: Argument list too long. in this directory about 25000 files, but actually there is only one argument to rm it is '*' sign. Why rm get list of all files in directore instead of deleting one by one?

Re: 'rm' Can not delete files

2012-02-07 Thread Matthew Seaman
On 07/02/2012 21:59, Коньков Евгений wrote: # rm * /bin/rm: Argument list too long. in this directory about 25000 files, but actually there is only one argument to rm it is '*' sign. Why rm get list of all files in directore instead of deleting one by one? It's the shell that expands

Re: 'rm' Can not delete files

2012-02-07 Thread Andre Goree
2012/2/7 Коньков Евгений kes-...@yandex.ru # rm * /bin/rm: Argument list too long. in this directory about 25000 files, but actually there is only one argument to rm it is '*' sign. Why rm get list of all files in directore instead of deleting one by one?

Re: 'rm' Can not delete files

2012-02-07 Thread Ingo Hofmann
What helps me sometimes is wrapping it up: for i in *; do rm $i; done Best, Ingo P.S.: Helps also with whitespaces in the filename where 'rm *' fails too. On 07.02.2012, at 14:10 , Rares Aioanei wrote: On 02/07/2012 11:59 PM, Коньков Евгений wrote: # rm * /bin/rm: Argument list too long.

Re: 'rm' Can not delete files

2012-02-07 Thread CK
Êîíüêîâ Åâãåíèé wrote: # rm * /bin/rm: Argument list too long. in this directory about 25000 files, but actually there is only one argument to rm it is '*' sign. Why rm get list of all files in directore instead of deleting one by one? Short answer: this is not Windows. Long answer: shell

Re: 'rm' Can not delete files

2012-02-07 Thread Randal L. Schwartz
Matthew == Matthew Seaman m.sea...@infracaninophile.co.uk writes: Matthew As you have discovered, it is very easy to overload the argument list. Matthew There are many ways around this, but one of the best ones is to use Matthew xargs(1). eg: Matthew% ls -1 | xargs rm No need for the

Re: 'rm' Can not delete files

2012-02-07 Thread RW
On Tue, 07 Feb 2012 22:14:56 + Matthew Seaman wrote: ls -1 | xargs rm but be aware that that wont work for filenames with spaces. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To

Re: 'rm' Can not delete files

2012-02-07 Thread Modulok
On 2/7/12, Коньков Евгений kes-...@yandex.ru wrote: # rm * /bin/rm: Argument list too long. in this directory about 25000 files, but actually there is only one argument to rm it is '*' sign. Why rm get list of all files in directore instead of deleting one by one? If you're removing