40

For Linux OS, How to filter the output of ls command in terminal to display only files created in February?

Amr Ragaey
  • 1,043
  • 1
  • 10
  • 16

2 Answers2

43
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'
Amr Ragaey
  • 1,043
  • 1
  • 10
  • 16
22

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
PalFS
  • 731
  • 6
  • 16