1

How can I list in long format all files (located in a directory) which belong to me (rights) and were modified more than 7 days ago?

2

Use the find command with an argument for files owned by a given username and modified over a certain time.

find -user username -mtime +7

EDIT: Optionally (if you use GNU find, mandatory if you use other implementations) you can add a directory location to search in like this: find /path/to/search -user username -mtime +7. GNU find assumes you want to search from the current directory if you do not specify a path.

  • you're missing the directory name in that find command – Mat Apr 2 '11 at 13:10
  • @Mat: depends if it is the GNU or BSD version of find. Here it looks like the GNU one. – shellholic Apr 2 '11 at 13:17
1

In zsh:

ls -ld *(u$UIDm+7)

u and m are globbing qualifiers to match files by owner and modification time respectively.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy