Fast way to recursively delete large amount of files.: Difference between revisions
(Created page with "Create an empty directory i the same folder as the one that contains the large amount of files you want to delete. <pre>mkdir empty_dir</pre> Then execute this command: <pre>r...") |
(No difference)
|
Revision as of 19:15, 25 April 2018
Create an empty directory i the same folder as the one that contains the large amount of files you want to delete.
mkdir empty_dir
Then execute this command:
rsync -a --delete empty_dir/ yourlargedirectory/
This command will grab everything in the directory "yourlargedirectory" and 'archive' it in "empty_dir" if a version of that already is there, else it will be deleted. This is remarkably faster that using the otherwise well known command
rm -rf yourlargedirectory/