Daily used or worth using Linux pages
1.How to find the Size of a directory --Directory Filesize
2. Get count of files from current directory in Linux
ls -1 | wc -l
3. Delete file solder than 150 days from current directory
find . -maxdepth 1 -type f -mtime +150 -exec rm -f {} \;
Same can be done as parallel execution.
nohup find . -maxdepth 1 -type f -mtime +150 -print0 | xargs -0 -n 1000 -P 10 rm -f
I have also written a python script for deletion of files from a folder . This can be found in my posts
Comments
Post a Comment