Listing files added in a particular month

how can I ouput all files in working directory added in a particular month using shellscript

Paste the output of ls -l
Which is your OS?

--ahamed

1 Like

thanks

If you are using Linux, you can use 'ls -l --time-style=+%b'

Below code print out only files

#! /bin/sh

if [ $# -ne 1 ]; then
  echo "Usage: $0 <month>"
  echo "        month - Jan, Feb, ... Nov, Dec"
  exit 1
fi

ls -l --time-style=+%b | awk -v month="$1" '$6==month && /^-/ { print $7 }'
1 Like