如何删除名为DBG_A_sql的8月7日创建的文件*
在/ tmp下
如下例所示:
-rw-r--r-- 1 root root 51091 Aug 7 11:22 DBG_A_sql.2135
-rw-r--r-- 1 root root 15283 Aug 7 11:22 DBG_A_sql.2373
-rw-r--r-- 1 root root 51091 Aug 7 11:22 DBG_A_sql.2278
-rw-r--r-- 1 root root 9103 Aug 7 11:22 DBG_A_sql.2485
-rw-r--r-- 1 root root 9116 Aug 7 11:22 DBG_A_sql.2573
-rw-r--r-- 1 root root 9140 Aug 7 11:22 DBG_A_sql.2679
-rw-r--r-- 1 root root 15695 Aug 7 11:22 DBG_A_sql.2897
解决方法:
你可以使用find.根据您的要求和用途计算日期,
find /tmp -maxdepth 1 -mtime -1 -type f -name "DBG_A_sql*" -print
确认后删除它们,
find /tmp -maxdepth 1 -mtime -1 -type f -name "DBG_A_sql*" -delete
标签:rm,linux,find
来源: https://codeday.me/bug/20190812/1643059.html