Find first created file date in YYYYMMDD format

Hi All,

We are copying all the files into ARCHIVE directory after we process them. We are doing this process from last 2 years, now we have a lot of files in ARCHIVE directory.

Now I need to find when the first file is copied into this directory?

If I Issue,
ls -l /ARCHIVE/*.* | tail -1

it is showing the file which is created first in archive directory but it is not showing the date in proper format(It is showing as Nov 26, there is no year).

Is there any way to got the date of the first created file in directory in YYYYMMDD format?

Thanks,

The year will appear when the last modification date will get older than 6 month.
if you care about last modification time use the -t option

if you want the latest:

ls -lrt | tail -1
or
ls -lt | head -1

if you want the oldest:

ls -lrt | head -1
or
ls -lt | tail -1

Thanks ctsgnb,

My problem is solved with --full option on ls.

ls --full <dir>

it is giving the long listing with year in it.

Thanks for the reply.

list file in YYYYMMDD format

ls -l --time-style="+%Y%m%d"