From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gustavo Guillermo Perez Subject: Re: Deleting many files from a directory Date: Sat, 25 Dec 2004 18:08:33 +0600 Message-ID: <200412251808.33457.gustavo@compunauta.com> References: <41CA927C.2000508@netual.pt> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <41CA927C.2000508@netual.pt> Content-Disposition: inline Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="iso-8859-1" To: =?iso-8859-1?q?M=E1rio=20Gamito?= , linux-admin@vger.kernel.org El Jueves 23 Diciembre 2004 15:40, M=E1rio Gamito escribi=F3: > Hi, > > When we have too many files in a directory, let's say thousands, we > cannot rm -f * on them. The system says there are too many files. > So, one must go through a tedious process of deleting by parts. > > Is there a way to wipe them all at onde ? > > Thank you. > > Warm Regards. if is Just a directory, call rm with the name of the directory like that rm -rf /dirname where the r is for recursive, sometimes find hangs with more than 65535= files=20 in a single directory in some older versions (I still using some ones). If you have a lot of folders with a lot of files, then: find -type d | while read dir; do rm -rf "$dir" ; done "" in $dir is for names with spaces. Mery Christmas --=20 ------- Gustavo Guillermo Perez Compunauta uLinux www.userver.tk - To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html