Linked Questions

4
votes
1answer
58k views

How do I find files older than 1 days using mtime? [duplicate]

I'm trying to remove all files more than 1 days old.Before I execute a script to remove the files,I try to find the files using mtime. however, I face same problem with my command- My Current date is ...
0
votes
1answer
3k views

What does the -mtime option for find actually do? [duplicate]

I cant find any documentation surround this option in google. I assume it looks for files created within x amount of days? but a quick and precise definition would be appreciated.
0
votes
2answers
934 views

Find command returning wrong data [duplicate]

I am using this command to list all files that have been modified in the last day (or created) find ./ -mtime 1 -ls However it keeps returning files from 30th April when I am running the command ...
0
votes
1answer
1k views

Behavior of find -mtime [duplicate]

I have the below files in directory new: Dec 14 04:35 New_folder Dec 13 05:50 abc.sh Dec 13 06:33 ashutosh.txt Dec 13 06:40 delete.sh Dec 13 07:19 test.bat Dec 14 04:44 test.sh Dec 14 04:30 xyz.sh ...
0
votes
1answer
677 views

find . -type d -mtime +1 only shows one file in a 4 day span [duplicate]

I was trying to use find with -mtime +1 to find all directories older than 24 hours but having issues getting this done. I understand that using -mtime +n should remove n*24 hours of data but it seems ...
0
votes
1answer
152 views

Deleting a file after X days does not work [duplicate]

I've tried multiple ways of writing this and I'm executing the script myself so it isn't the crontab that isn't working. These are examples of what I've tried : find /home/backups -mtime +1 -exec rm {...
10
votes
2answers
548 views

find command: -size behavior

I have a question concerning the find command in Linux. In all the articles I've found online it says that attribute -size -10M, for example, returns files that are less than 10 MB in size. But when I ...
3
votes
2answers
17k views

Deleting older log files

There are some log files created after a certain amount of time with the time stamp. /mylog/path Log_file_2018-07-19-22-55-31Z.tgz Log_file_2018-07-20-01-29-11Z.tgz Log_file_2018-07-20-10-36-49Z.tgz ...
1
vote
1answer
860 views

How can I get files using find command

How to use find command to get only files from the current directory (excluding subdirectories and its files) older than a day on AIX?
1
vote
1answer
4k views

Bash script to detect a file modified yesterday and check if its size is above a certain threshold

I'm writing a script to stat all files in a directory, and then find specific files that were created yesterday and tell me if they are larger than a certain size or not. So basically I need this to ...
0
votes
1answer
673 views

Find command time parameter values are confusing

From find manual: mtime n File's data was last modified n*24 hours ago. So find . -mtime 0 should find what was modified n*24 hours ago, which is 0*24 hours ago, which is 0 hours ago. But it ...
0
votes
1answer
262 views

How to show all files with some filters?

I need to display on screen all the files that hang recursively from the root and that have not been modified in the last two days, with a size smaller than 5 KB. I can show the files that hang ...
0
votes
1answer
76 views

Remove specific file if it hasn't been modified for 1 day

I want to delete the specific file, std_info under /tmp, if it hasn't been modified within a day (or 1440 minutes). For now, I created the following syntax that prints only the files that were ...
0
votes
0answers
45 views

Unable to make find command work

My Goal is to find the files and delete them which are older than 1 day. I am using the command to find(list them) with find /trunk/logs/ -mtime +1 -name '*.log' -ls > $LogName or find /trunk/logs/...