![]() To find and delete files with a specific extension, simply specify the extension with the file name to be searched. Simply run the find command to search for the specific file and then use rm command to delete:įind /Downloads/Images -type d -mtime 90 find /Downloads/Images -type d -mtime 30 -exec rm -rf \ Find and Delete Files With. It is so because the -delete option may fail if the directory is not empty. To find and delete files recursively in Linux, we will use the rm command. wav files from the directory belgacomsfmessages older than two days with the following commands. I try to write a ksh script in AIX to tar, compress and remove the original. Note that the -mtime option specifies to run the find command and to delete files that were modified at least 5 days ago. 1 04-20-2009 edr Registered User 2, 0 How to tar, compress and remove files older than two days Hi, Im Eddy from Belgium and Ive the following problem. name "example*.txt" -type f -mtime 5 -delete Run the following commands to find to delete files which are older than 30 days:įind. In any case, for both -find -mtime 30 and zsh 's m 30 glob qualifier, note that it selects files that are 31 days old or older, as it compares the age in terms of integer number of days. The -mmin stands for the modification time in minutes and 15 means we want to find files that were last modified 15 minutes ago or earlier than the specified time. oldfiles (/h/USER/.txt (NDm 30/)) if ( (oldfile)) then rm -f - oldfiles else echo >
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |