Shell – ls -e option not available in linux

linuxlsshell-script

I have shell scripts that run on Solaris UNIX that use the -e option on ls to ensure the same format for all files regardless of their age. This option is not available on Linux. The exact same format is important. Is there a similar option I can use for Linux? Or better yet, is there a way to update ls to use the -e option? That way I won't have to create exception code for Linux.


OpenSolaris manpage for ls:

-e The same as -l, except displays time to the second, and with one format for all files regardless of age: mmm dd hh:mm:ss yyyy.

Best Answer

Using --time-style=+FORMAT you can set the formatted output like ls -l --time-style=+"%b %_d %H:%M:%S %Y"

Perhaps you can set an alias on the Linux hosts to default the --time-style on every ls invocation.

Related Question