-2

how to find files based upon time information, such as creation, modified and accessed. It is useful to find files before a certain time, after a certain time and between two times. what command in Linux would i have to use ?

I understand to find setuid files on linux computers i would have to use :

find / -xdev ( -perm -4000 ) -type f -print0 | xargs -0 ls -l

How do i check for files which have been modified in the last 30 minutes. (I created a new file called FILE2)

mosquitos
  • 53
  • 8
sumr
  • 25
  • 3
  • 11
  • Take a look to find manual ;) – DonCallisto Sep 27 '14 at 11:30
  • Offtopic for SO. Belongs on superuser.com, perhaps – Jarmund Sep 27 '14 at 11:31
  • BTW, your command can be more easily written as `find / -xdev ( -perm -4000 ) -type f -ls`. I think you can also drop the parentheses and `-xdev` might be unnecessary as well, depending on where you really wanna search. Again, refer to the man and make the choice yourself. – SukkoPera Sep 27 '14 at 11:32
  • Check this and the manual http://stackoverflow.com/questions/16085958/scripts-find-the-files-have-been-changed-in-last-24-hours – sotcha Oct 08 '14 at 22:53

2 Answers2

1

Just add -mtime -30m. I might be wrong about the actual syntax, but you get the idea. See man find.

SukkoPera
  • 621
  • 4
  • 8
1

Answer on your question is

find . -cmin -30 -exec ls -l {} \;
mosquitos
  • 53
  • 8