For Linux OS, How to filter the output of ls command in terminal to display only files created in February?
How to filter the output of ls command to display only files created in February?
touch --date "yyyy-mm-dd" /tmp/start
touch --date "yyyy-mm-dd" /tmp/end
find /my/path -type f -newer /tmp/start -not -newer /tmp/end
or
ls -l | grep 'yyyy-mm-dd'
You can simple grep the output to filter out only Feb files
ls -l | grep "Feb"
If you want to filter out files in the sub directories also then
ls -l -R | grep "Feb"
Note
- R flag means recursive
© 2022 - 2024 — McMap. All rights reserved.
ls -l
?| grep Feb
. I add the question mark because this will setup your time. Here you can print based on modification time, creation time, etc. It's up to you, read the man pages. – Berthold