Search code examples
linuxterminallssuperuser

How to filter the output of ls command to display only files created in February?


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


Solution

  • 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'