6

How do I list/find all the files created on Sundays or Mondays?

How do I use the date parameter to display them?

Something like :

ls -f date + %a

or

find -type f | date +%A

or

find -type f -mtime -6

2 Answers2

9

Something like this?

find -type f -printf '%Ta\t%p\n' | egrep "^(Sun|Mon)" | cut -f 2-

Note that this uses the file's last modification time, not creation time (which, as far as I know, isn't kept anywhere)

Itay Perl
  • 281
1

In *nix operating systems there is no way to get the file creation date. mtime will give you last modification time and atime will give you last accessed time. But there is no way to get the file creation time.

If you need creation time then you have to save it in some file yourself.

Abhay PS
  • 111