Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hi
i need to remove the directory with millions of small files (less then 100k each). my filesystem is ext3. when i run "rm -vfd mydir" i have got "rm: cannot remove `mydir': Is a directory".
"rm -rvf mydir" works, but it works very-very slow. in fact i need some weeks to remove files recursively. is there another way to unlink all this files?
Actually 'rm -rf' will not care about non-empty directories.
Having millions of files might already have fragmented your disk to an unbearable amount, maybe you already notice slow performance on that disk. You can also try 'smartctl' to find out how healthy your hard disk is.
If the drive does not contain system files, and you know what data you want to keep, then copy the needed data to a safe place and reformat the partition.
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
Quote:
Originally Posted by salter
Actually 'rm -rf' will not care about non-empty directories.
Having millions of files might already have fragmented your disk to an unbearable amount, maybe you already notice slow performance on that disk. You can also try 'smartctl' to find out how healthy your hard disk is.
If the drive does not contain system files, and you know what data you want to keep, then copy the needed data to a safe place and reformat the partition.
Depending on what the disk was formated in it will not suffer from fragmentation due to how ext2 and 3 and all other filesystems attempt to store its files. Here is a good explanation. Not saying it can't be just that it is highly unlikely. http://geekblog.oneandoneis2.org/ind..._defragmenting
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.