I can\'t seem to find how to print out the date of a file. I\'m so far able to print out all the files in a directory, but I need to print out the dates with it.
I
If file name has no spaces:
ls -l | awk '{print $6, " ", $7, " ", $8, " ", $9 }'
This prints as the following format:
Dec 21 20:03 a1.out
Dec 21 20:04 a.cpp
If file names have space (you can use the following command for file names with no spaces too, just it looks complicated/ugly than the former):
ls -l | awk '{printf ("%s %s %s ", $6, $7, $8); for (i=9; i<=NF; i++){ printf ("%s ", $i)}; printf ("\n")}'