Contents
3 Answers. You could start by saying find /var/dtpdev/tmp/ -type f -mtime +15 . This will find all files older than 15 days and print their names. Optionally, you can specify -print at the end of the command, but that is the default action.
How do I find old files on Linux?
Find and Delete Files Older Than X Days In Linux
- dot (.) – Represents the current directory.
- -mtime – Represents the file modification time and is used to find files older than 30 days.
- -print – Displays the older files.
How do I get a list of files in Linux?
15 Basic ‘ls’ Command Examples in Linux
- List Files using ls with no option. …
- 2 List Files With option –l. …
- View Hidden Files. …
- List Files with Human Readable Format with option -lh. …
- List Files and Directories with ‘/’ Character at the end. …
- List Files in Reverse Order. …
- Recursively list Sub-Directories. …
- Reverse Output Order.
22 авг. 2012 г.