shell - Print a file's last modified date in Bash -


i can't seem find how print out date of file. i'm far able print out files in directory, need print out dates it.

i know need attach date format echo of entry, can't find correct format.

echo "please type in directory want files listed"  read directory   entry in "$directory"/*   echo "$entry" done 

you can use stat command

stat -c %y "$entry" 

more info

 %y   time of last modification, human-readable 

Comments