hans

hans

【Shell】Quickly clean up a large number of files


Installation on Ubuntu:

sudo apt-get install rsync

Create an empty folder as you like

rsync --delete-before -d path-to-empty-folder path-to-target-folder

Related parameters:

–delete-before The receiver deletes files before transferring
–progress Display the transfer progress during transmission
-a Archive mode, which means recursively transferring files and preserving all file attributes
-H Preserve hard-linked files
-v Verbose output mode
–stats Provide the transfer status of certain files
-d Do not transfer files recursively

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.