help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Command failure: Too Many Files (rm, ls, tar)


From: Henrik Carlqvist
Subject: Re: Command failure: Too Many Files (rm, ls, tar)
Date: Tue, 15 Apr 2008 18:23:23 +0200
User-agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)

"Browder, Tom" <Tom.Browder@fwb.srs.com> wrote:
> Last week I started getting errors indicating there were too many files
> for the command (rm *, ls *, tar cvzf xfer.tgz *) to continue.

Some quick workarounds:

find . -type f -maxdepth 1 -name "*" -exec rm {} \;

The above will only remove files at your current directory, any files in
directories below will not be removed. If you have no subdirectorires it
will be more simple to type:

find . -exec rm {} \;

With that simple command you will get an error message about being unable
to remove . (current directory) and .. (directory above) and this command
will unlike "rm *" also remove files which start with a dot.

The command

find . -maxdepth 2 -name  "*"

will give you approximately the same result as "ls *".

tar cvzf xfer.tgz .

might be more useful that using wildcard.

regards Henrik
-- 
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost



reply via email to

[Prev in Thread] Current Thread [Next in Thread]