Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:00:57+00:00 2026-06-12T13:00:57+00:00

I am trying to figure out the command to display all files created 30

  • 0

I am trying to figure out the command to display all files created 30 minutes (as an example) before and after another file was created. So far I managed to find files newer than that file
but I cannot work out how to look for both before and after given time.

A command I have used:
find -type f -newer file.txt -cmin -30

This works fine but only does half of what I am trying to do.
Also, I need to modify that to search for setuid files only, which I THINK I can do by adding the -perm -4000 in that command.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:00:58+00:00Added an answer on June 12, 2026 at 1:00 pm

    As far as I know there is no way to find file creation time.
    You can try by modification time (this will get all files last-modified between 5th and 8th)

    find . -type f -newermt 2012-10-05 ! -newermt 2012-10-08
    

    (or access time replace newermt with newerat)

    newerXY is flag to compare timestamps of current file with reference (see man find for more info).

    According to man find (on my debian) there are 4 flags (aside from t to interpret directly as time)

    a   The access time of the file reference
    B   The birth time of the file reference
    c   The inode status change time of reference
    m   The modification time of the file reference
    

    You can also try with 'B' birth time but it does not work for me, gives me error. I don’t know why it is included in the man page

    compare to another file

    find / -newer file
    find / ! -newer file
    

    You can create temp file (one with modification time 30 min before the target file, another 30 mins after)

    touch -d `stat -c %y test.txt` - 30 temp/before_temp
    touch -d `stat -c %y test.txt` + 30 temp/after_temp
    
    find / -newer temp/before_temp ! -newer temp/after_temp
    

    touch -d takes a date option, so if you add and subtract correctly, this should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to figure out a command that will search through 13+ files
Trying to figure out why File Attachment isn't showing on a custom content type.
Trying to figure out how to write a command across multiple lines because the
I am trying to figure out what the following command would do. I extracted
I've been trying to figure out how to run a bash command in a
I'm trying to figure out how to run Python programs with the Command Prompt
I'm trying to figure out what format the output is from the getevent command
I'm trying to figure out the function command in Matlab and im having some
I am currently trying to figure out how to connect to another server via
I am trying to figure out how to run a SSH command via cron

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.