How to delete all files from a folder at once?

General support questions
Post Reply
Psychotic_OZ
Posts: 8
Joined: 2017/05/24 09:38:28

How to delete all files from a folder at once?

Post by Psychotic_OZ » 2017/05/25 09:14:40

Hello i want to delete my minecraft world folder all at once without have to do it one file one at a time or using filezila. is there a way to delete the folder and all the files in it at once?

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to delete all files from a folder at once?

Post by jlehtone » 2017/05/25 09:45:22

Note that these two are different tasks:
to delete all files from a folder?
to delete the folder and all the files in it?
rm -r foldername

bertalanimre
Posts: 140
Joined: 2015/06/02 13:04:03

Re: How to delete all files from a folder at once?

Post by bertalanimre » 2017/05/25 12:03:01

If you are brave enough :)

Code: Select all

rm -rf /folder/name/*

CaViCcHi
Posts: 68
Joined: 2012/04/18 17:03:15
Contact:

Re: How to delete all files from a folder at once?

Post by CaViCcHi » 2017/05/25 20:02:07

I'd suggest you delete the directory directly without caring for the files

rm -rf /the/directory/

without * as I've seen funny things happening with wildcards and symlinks

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: How to delete all files from a folder at once?

Post by desertcat » 2017/05/29 07:49:13

Psychotic_OZ wrote:Hello i want to delete my minecraft world folder all at once without have to do it one file one at a time or using filezila. is there a way to delete the folder and all the files in it at once?
As others have said you can do it from the command line -- I have, but as a last resort. My preferred method is simply to delete it using mc (Midnight Commander). Select the file, folder, etc., and hit F8, it will ask you if you want to delete file, folder, etc. just say yes. As someone pointed out deleting stuff from the command line can be dangerous. If you choose to delete from the CLI just be VERY CAREFUL.

Post Reply