Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all files modified in last 5 minutes excluding .svn directories

Tags:

bash

terminal

People also ask

Which command shows files modified in last 5 minutes?

Syntax of find command with “-mmin n” option -n : find command will look for files modified in last n minutes.

Which command will to find all files which are changed in last 1 hour?

Thus find -ctime 0 finds everything for which the inode has changed (e.g. includes file creation, but also counts link count and permissions and filesize change) less than an hour ago.

How do you find all the files modified in less than 3 days and save the record in a text file?

Use -mtime option with the find command to search files based on modification time followed by the number of days. Number of days can be used in two formats.


Try a different order of arguments. Your command:

  • If an entry is accessed within five minutes and is a directory and has the name .svn, then the entry is ignored
  • otherwise, for all other cases, if it's a file, print the name

The following command prunes .svn directories before descending into them:

find . -type d -name .svn -prune -o -mmin -5 -type f -print

If a file is a directory and has the name .svn, ignore it and do not descend into it either. Otherwise, if it is last modified (-mmin) within 5 minutes and a file, print the filename.


-atime looks at the last accessed time. I think you're looking for -mmin. I've only got cygwin handy so I can't test it...


-and is assumed between -atime and -type d, so you are pruning only SVN directories older than 5 minutes. Try:

find . -type d -name .svn -prune -o -type f -mmin 5 -print