A. I used the following code to get the modified date of a file. But this is also selecting the subdirectories and thus returning an error. How can I fix this?
for file in $1/*; do
echo `stat -c %y $file | cut -d ' ' -f1`
$1 is the directory I am passing.
B. Also is there any way to do this thing. That I need to pass a directory and date range as command-line argument and list the file and modified date which lies in this date range.
output.sh /home/user/desktop 2014-10-07 2014-11-17 should list all the files in this directory which are modified in this time interval.