kmfkinnovations.blogg.se

Linux find files by date
Linux find files by date











In this case %b matches the 3 letter month and %e is a space-padded day value matching the format of ls instead of a 0-padded day value that the default date uses. GNU date formatting is really helpful for outputting your date exactly how you need. Ls -ltr directory/ | grep "$(date +"%b %e")" Does the same thing and requires no awk print statements or conditionals. Why not just use gnu date's built in formatting instead?

linux find files by date

That said, all the ls solutions seem really cumbersome piping to awk.

linux find files by date

I think these ls commands are far better than using find if the additional file metrics that find (which just returns filenames) does not provide are needed.













Linux find files by date