Linked Questions
                        20 questions linked to/from Efficiently delete large directory containing thousands of files
                    
                
            
            
                13
            
            votes
        
        
            
                8
            
            answers
        
        
            
                73k
            
            views
        
        
            
            
        Faster way to delete large number of files [duplicate]
                    I have a directory where lots of cached files are getting generated very quickly. Since these are very small files, it is consuming all my inodes very quickly. 
Currently I am running the following ...
                
            
       
        
            
                17
            
            votes
        
        
            
                5
            
            answers
        
        
            
                18k
            
            views
        
        
            
            
            
        How can I delete a folder with lots of subfolders fast? [duplicate]
                    I have a folder with 266778 subfolders. How can I delete it?
I have tried
cd ~/.local/share/Trash/
sudo rm -rf *
but it takes much time. After 1 minute 25 seconds real time and 0.072 seconds user ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                2k
            
            views
        
        
            
            
        Delete millions of files efficiently, without first generating a list of all files to be deleted [duplicate]
                    I've been trying to figure out how to delete millions of files from a mounted NAS drive. The OS I'm accessing it from is RHEL 7.6. 
The directory is actively being written to, with tens or hundreds ...
                
            
       
        
            
                0
            
            votes
        
        
            
                2
            
            answers
        
        
            
                312
            
            views
        
        
            
            
            
        how to delete files in folder with thousands of files [duplicate]
                    in  the folder 
cd /var/log/hive
I guess we have thundered of log files 
I say that because
if I do under this folder
ls -l
then its stuck and only CNTRL C , will exit
so I cant to vew all files
...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                415
            
            views
        
        
            
            
        Deleting LARGE number of files (exec, loops..) [duplicate]
                    I have a very large number of files to delete, which go by the following format:
esymac_logEvents.log.5_2017-Feb-06_02-39-17.Z_2017-Feb-08_02-39-14.Z_2017-Feb-09_02-39-14.Z_2017-Feb-11_02-39-11....
                
            
       
        
            
                1
            
            vote
        
        
            
                0
            
            answers
        
        
            
                161
            
            views
        
        
            
            
        Most efficient way of purging of 10TB data from SAN? [duplicate]
                    I want to purge storage data from SAN which accumulates to 10 TB. The OS is linux. The storage is mounted as mount-points on a system for which it is visible I was recommended by a friend to use ...
                
            
       
        
            
                74
            
            votes
        
        
            
                8
            
            answers
        
        
            
                160k
            
            views
        
        
            
            
        How do I recursively shred an entire directory tree?
                    I have a directory tree that I would like to shred with the Linux 'shred' utility.  Unfortunately, shred has no -R option for recursive shredding. 
How can I shred an entire directory tree ...
                
            
       
        
            
                44
            
            votes
        
        
            
                6
            
            answers
        
        
            
                30k
            
            views
        
        
            
            
            
        Deleting billions of files from a directory while seeing the progress as well
                    I have a directory of 30 TB having billions of files in it which are formally all JPEG files. I am deleting each folder of files like this:
sudo rm -rf bolands-mills-mhcptz
This command just runs and ...
                
            
       
        
            
                23
            
            votes
        
        
            
                4
            
            answers
        
        
            
                80k
            
            views
        
        
            
            
            
        What's the fastest way to remove all files & subfolders in a directory? [duplicate]
                    One program created lots of nested sub-folders. I tried to use command
 rm -fr * to remove them all. But it's very slow. I'm wondering is there any faster way to delete them all?
                
            
       
        
            
                15
            
            votes
        
        
            
                6
            
            answers
        
        
            
                4k
            
            views
        
        
            
            
            
        Reset ext4 filesystem without changing the filesystem UUID
                    I have a filesystem with many small files that I erase regularly (the files are a cache that can easily be regenerated). It's much faster to simply create a new filesystem rather than run rm -rf or ...
                
            
       
        
            
                31
            
            votes
        
        
            
                2
            
            answers
        
        
            
                22k
            
            views
        
        
            
            
        iotop showing 1.5 MB/s of disk write, but all programs have 0.00 B/s
                    I don't understand iotop output: it shows ~1.5 MB/s of disk write (top right), but all programs have 0.00 B/s. Why?
The video was taken as I was deleting the content of a folder with a few millions of ...
                
            
       
        
            
                12
            
            votes
        
        
            
                3
            
            answers
        
        
            
                33k
            
            views
        
        
            
        recursive delete with sftp?
                    I have a host that I can only access with sftp, scp, and rsync-- no ssh. I have a large tree of directories that I want to delete, but my sftp client apparently does not support recursive rms or ...
                
            
       
        
            
                4
            
            votes
        
        
            
                3
            
            answers
        
        
            
                4k
            
            views
        
        
            
            
            
        Removing dirs with lots of tiny files on Lustre
                    I have a dir with a gigantic amount of very small files that I want to remove and simply removing the dir with rm -rf /path/to/the/dir is already taking multiple days.
It might sound strange that ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                14k
            
            views
        
        
            
            
            
        Remove everything within directory using for loop
                    I am trying to remove large amount of mails (mostly mail delivery failed) from my server using
 rm -rf /home/*/mail/new/*
And I am getting -bash: /usr/bin/rm: Argument list too long
I tried using ...
                
            
       
        
            
                5
            
            votes
        
        
            
                4
            
            answers
        
        
            
                869
            
            views
        
        
            
            
            
        Most efficient way to thin out a backup which uses hardlinks
                    I have a backup disk which contains hundreds of backups of the same machine from different dates. The backup was made with rsync and hardlinks, i.e. if a file doesn't change the backup script just ...