![]() You can choose any folder on any hard drive that's plugged in, including removable ones, as well as the entire hard drives. Resources: Banner images from Office illustrations by Storyset and Canva.Unable to delete files directly from the program.Īn update hasn't been released since 2010.ĭisktective is portable and takes up less than 1 MB of disk space, so you can carry it with you on a flash drive.Įach time it opens, you're asked what directory to scan. In this article, we have studied the find command in detail and learned how to search files by name, type, size and modification time. ![]() The shared script is very useful in archiving and removing logs. As we do not want the shell to interpret the semicolon, we escape it with \. # Script to move from logs older than 7 days to backup logs path: /app/backup_logs/ESB0*įind /logs/esb01/audit -name "*.tar.gz" -mtime 7 -exec mv is the placeholder which holds the results of the command. We can create a script and schedule it with cron. From there, it deletes log files older that older than 30 days. Let's say we want to create a script that moves log files older than 7 days to a backup path. We can combine find with rm or mv to create meaningful bash scripts that can be automated. Practical examples of find with bash scripts type f -name ".*" -mtime 10 Here we have files that were modified more than 10 days ago. Let's apply an example in my home directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |