Efficiently delete large directory containing too much of files


1. Rsync

Be sure to have backups of your files just in case.
When logged into your Retain Server, first you will need to create a new directory in any location of your choice.

mkdir empty_dir

Next, you will run this command.  empty_dir is the new directory you just created and yourdirectory is the directory you wish to remove:

rsync -a --delete empty_dir/ yourdirectory/

Once this command completes, both the new directory you created and the directory you wish to have deleted will still exist but all content inside them will be gone.  you can then manually remove those directories using the rm command.

2. Perl

cd yourdirectory/

perl -e 'for(<*>){((stat)[500000]<(unlink))}'


Check: limit the number of files printed by ls: ls -U | head -10





Comments

  1. However, debit playing cards, credit cards, and bank transfers are also accepted. You might need to wait roughly 48 hours in your withdrawal request to be approved. For a fantastic start, you have to discover the best and trustworthy site. There are hundreds of on-line playing websites, and finding the best one which does you could be an uphill task. However, 토토사이트 there are numerous issues you could look out for guarantee that|to ensure that} you get a trustworthy and reliable casino site.

    ReplyDelete

Post a Comment