Search Our Database

How to Remove a Folder With Millions of Files

Last updated on |

When connected to a Linux terminal, if the folder contains too many files, using rm command will not be able to remove them. To remove it:

cd /directory
# where directory is the directory of the folder that you want to remove
find . -type f -print -delete

Running the command above removes all files in the selected directory. Once that has been done, run the following command to remove the folder:

rm -rf /directory