Score:1

Find files from timestamps

kr flag

I have a lot of files, of which I need to show only those created in the last 3 hours, and sort this list by date. I tried to do it with the following command:

find /root/shell/copy/ \( -type f -mmin +180 \) | get_crtime | xargs ls -t | head -1

get_crtime is a function created for .bashrc as shown in this example to find out the date of creation for a file.

How can I use the command correctly?

enter image description here

hr flag
What is the end goal? Are you sure you want *creation time* rather than *modification time*?
Par4o avatar
kr flag
@steeldriver my end goal is to upload files created in more than 3 hours, and from the resulting list to sort by the newest, it is the creation date that interests me
hr flag
But *why* do you believe that you need creation time? It's not widely used in Linux, and your `find -mmin` is going to return files based on modification time anyhow.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.