This article explains how to delete files older or newer than N days, with extra examples like matching only files using a particular extension, and more. For this we'll usefind, a command line tool to search for files in a directory. You can delete all files and foldersolderthan (with ...
Find Thefindutility offers much more advanced functionality. Below is an example from a script I've installed on a number of servers that I administer to ensure that a specific pattern of file (also known as a glob) exists for only five days and all files older than that are deleted. (S...
The files and subdirectories here are meant to be read primarily by programs rather than humans, but you can get an idea of what they contain and represent by looking at an example such as the /dev file. Running cat dev in this directory displays the numbers 8:0, which happen to be t...
find dir[ ...] -atime T find dir[ ...] -ctime T find dir[ ...] -mtime T find dir[ ...] -newer NAME -atime T:列出atime在指定时间被更新过的文件。 -ctime T:列出ctime在指定时间被更新过的文件。 -mtime T:列出mtime在指定时间被更新过的文件。 -newer NAME:使用文件或目录比较,列出比...
(This saves a significant amount of memory.) In addition, the boot-time init tends to be very simple on embedded systems. However, you typically won’t find these limitations to be a problem, because custom Linux firmware often includes a web administration interface similar to what you’d ...
- remove backup, recreate newer but smaller backup - sort for upload and keep less than 36 items in each folder - find . -type f -name "*.jpg" -exec mogrify -resize 800 {} \; - tar -czvf foo.tar.gz bar - upload tarball
1.find 2.grep 过滤查找及“|”管道符 3.which 六、压缩和解压类 1.gzip/gunzip压缩 2.zip/unzip压缩 3.tar 七、进程线程类 1.ps 2.kill 3.netstat 八、crond系统定时任务 1.crontab 九、补充 1、nohup 2、zcat 3、uniq 4、dirname 5、seq 6、export ...
find . -mnewer poop # 2) returns a list of new files rm poop # 3) rm the temp file find with time: this works on mac os x --- find / -newerct '1 minute ago' -print find and tar --- find . -type f -name "*.java...
-mtime days => Finds files that are 'days' old. ('+' => More than, '-' Less than ) -size nums => Find files that are size of 'num'. ('+' => More than, '-' Less than ) -newer file => Find files that are newer than 'file' -type d => Find files that are of typ...
find . -type f -mtime +30This will find all regular files over 30 days old under the current directory (denoted by the dot).The find command allows searching for files based on all kinds of advanced conditions like name, size, permissions, timestamps, ownership, and more....