I am not sure if it is possible.
I do ls -l, it gives all the files in the current directory. Is there a way to say list only files that weren't created/modified on Saturday's with shell command?
I am not sure if it is possible.
I do ls -l, it gives all the files in the current directory. Is there a way to say list only files that weren't created/modified on Saturday's with shell command?
A way to do this :
$ LANG=C find . -maxdepth 1 -printf '%p %AA\n' |
awk '$NF=="Saturday"{next}{$NF=""}1'
I assume we don't print files for all Saturdays. This is or not what you expect.
You should select which time you need
%y modification %w creation%z changeor any combination:
stat * --printf="%n\t%y %z\n" | grep -vF $(date -d "last Saturday" +%F) | cut -f1
Also choice what infomation you need and compose --printf= line.
Or you can use just find command
find -maxdepth 1 -type f -daystart \
! -mtime $[$(date +%d)-$(date -d "last Saturday" +%d)]
saturnism.dat? – Gilles Quénot Nov 17 '14 at 17:03^– Ketan Nov 17 '14 at 17:05