Finding and deleting files with a specific date

yael

how to delete the files that created on Aug 7 with the name DBG_A_sql* under /tmp

as the following example:

-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
Rahul

You can use find. Calculate date according to your requirement and use,

find /tmp -maxdepth 1 -mtime -1 -type f -name "DBG_A_sql*" -print

After confirming it delete them,

find /tmp -maxdepth 1 -mtime -1 -type f -name "DBG_A_sql*" -delete

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Finding files in a specific date and then search for a phone number

From Dev

Finding files in a specific date and then search for a phone number

From Dev

finding a specific date in MySql

From Dev

Deleting specific files in command line

From Dev

Deleting specific files in command line

From Dev

Finding index of specific date in dateTimeArray

From Dev

Finding files not ending with specific extensions

From Dev

Finding files not ending with specific extensions

From Dev

finding specific files and data inside files

From Dev

Finding duplicate records from table and deleting all but one with latest date

From Dev

Finding duplicate records from table and deleting all but one with latest date

From Dev

Finding text files with less than 2000 rows and deleting them

From Dev

Deleting specific files based on filename from terminal

From Dev

Deleting all files except a specific one?

From Dev

Nodejs deleting uploaded files after specific time

From Dev

Batch script deleting specific lines in multiple files

From Dev

Finding number of days and months in between specific date

From Dev

Finding files within date range suffix

From Dev

Finding files based on the date contained in their filenames

From Dev

Finding object key and deleting it

From Dev

delete all files of specific pattern without deleting the presently using file

From Dev

Deleting files in specific sub-directories created at random

From Dev

UNIX command for deleting / removing files on today's date

From Dev

Deleting files older than 30 days based on filename as date

From Dev

Deleting files in a pattern dump-{date}.-id.zip

From Dev

Finding newest data older than a specific date in R

From Dev

Finding match from a specific columns across two files

From Dev

Finding files with specific name and making output like txt

From Dev

finding out the created or accessed or modified date of all files in directory

Related Related

  1. 1

    Finding files in a specific date and then search for a phone number

  2. 2

    Finding files in a specific date and then search for a phone number

  3. 3

    finding a specific date in MySql

  4. 4

    Deleting specific files in command line

  5. 5

    Deleting specific files in command line

  6. 6

    Finding index of specific date in dateTimeArray

  7. 7

    Finding files not ending with specific extensions

  8. 8

    Finding files not ending with specific extensions

  9. 9

    finding specific files and data inside files

  10. 10

    Finding duplicate records from table and deleting all but one with latest date

  11. 11

    Finding duplicate records from table and deleting all but one with latest date

  12. 12

    Finding text files with less than 2000 rows and deleting them

  13. 13

    Deleting specific files based on filename from terminal

  14. 14

    Deleting all files except a specific one?

  15. 15

    Nodejs deleting uploaded files after specific time

  16. 16

    Batch script deleting specific lines in multiple files

  17. 17

    Finding number of days and months in between specific date

  18. 18

    Finding files within date range suffix

  19. 19

    Finding files based on the date contained in their filenames

  20. 20

    Finding object key and deleting it

  21. 21

    delete all files of specific pattern without deleting the presently using file

  22. 22

    Deleting files in specific sub-directories created at random

  23. 23

    UNIX command for deleting / removing files on today's date

  24. 24

    Deleting files older than 30 days based on filename as date

  25. 25

    Deleting files in a pattern dump-{date}.-id.zip

  26. 26

    Finding newest data older than a specific date in R

  27. 27

    Finding match from a specific columns across two files

  28. 28

    Finding files with specific name and making output like txt

  29. 29

    finding out the created or accessed or modified date of all files in directory

HotTag

Archive