Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Large number of files in single directory

Large number of files in single directory

2005-05-25       - By Stephen Carville

 Back
Reply:     1     2     3     4     5     6     7     8  

Burke, Thomas G. wrote:
> I delete them by character...  e.g. rm -rf *1.tmp, rm -rf *2.tmp, and so on.
Don't know of any other way to do it. - although I wrote a little C program
once to handle it for me.
>  
>     -Tom
>
> -- --Original Message-- --
> From: redhat-list-bounces@(protected) [mailto:redhat-list-bounces@(protected)
]On Behalf Of Chris
> Sent: Wednesday, May 25, 2005 1:19 PM
> To: redhat-list@(protected)
> Subject: Large number of files in single directory
>
>
>
> There seems to be a filesystem limitation on most flavors of Linux I've
> worked on, in terms of a max number of files in a single directory - before
> tools like tar, gzip, rm, mv, cp and others stop working properly.  For
> example, I have some users that have 2000+ files in a single directory (some
> as many as 10,000 files) and trying to tar these directories is always
> coming up with "argument list too long."

This is beacue of the limit of the length of the command line.  There is
a limit on the number of files in a directory but I don't knoiw what it
is and I haven't hit it yet.  IIRC, the targets I've dealt with was 40K+

> Is there a way for tar and these other tools to "see" all these files and
> process them as normal?  I recall once I had to resort to something like
> "find . -print | xargs rm -fr" to remove thousands of files from a single
> directory.  Is doing something similar but replacing "rm" with "tar" the
> only way to make this work, or does tar have some sort of command line
> switch (I couldn't find one) to work with extremely long argument lists?

Try:

$ find <directory> -exec tar -avf foo.tar {} \;

> Chris
>
>


--
Stephen Carville <stephen@(protected)>
Unix and Network Admin
Nationwide Totalflood
6033 W. Century Blvd
Los Angeles, CA 90045
310-342-3602

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

Earn $52 per hosting referral at Lunarpages.