cyprich.com

By

Quickly Deleting Files on Linux

Once in a while I need to delete all of the files and folders on my Linux hosting account. This is usually due to updating an application, installing a new web application, or more often installing a clean application in my testing folder.

I would normally use WinSCP, but the problem with deleting files through this is that when there are thousands and files and folders, the process could take a long time. Deleting a Joomla installation, for example, takes more than 30 minutes to do.

A faster way to delete files is to go into your shell account (assuming your web host allows you to have one), and from the root directory, enter the following command:

rm –r folder

This will recursively delete all items in the folder and then delete the folder itself. If the folder is a subdomain, then recreate it using the rmdir command. This process takes seconds as opposed to the method used in WinSCP.

Banner

2 Responses to Quickly Deleting Files on Linux

Leave a Reply

Your email address will not be published. Required fields are marked *