LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ls -l showing different date formats (http://www.linuxquestions.org/questions/linux-newbie-8/ls-l-showing-different-date-formats-690925/)

SmurfGGM 12-16-2008 05:32 AM

ls -l showing different date formats
 
Howdy,

When I am logged on as root and do an ls -l, I get the date format as 'Dec 16' etc ..

drwxrwxrwx 12 oracle dba 496 Dec 16 03:02 .
drwxrwxr-x 13 efin efin 416 Nov 13 16:50 ..

When I am logged on as a different user, oracle for example, I get the date in ISO format ..

drwxr-xr-x 2 oracle efin 112 2008-12-16 03:02 archive
-rw-rw-rw- 1 oracle dba 855 2008-12-16 11:02 dirlist

I want to be able to list the date as ISO format when I am the root user. Can anyone advice on how I do this please ?

Cheers !

kaz2100 12-16-2008 05:40 AM

Hya,

1. Read man page of ls, look for date format.
2. Check your locale.

3. See what happens and if you have further question, come back here,

Happy Penguins!

SmurfGGM 12-16-2008 05:42 AM

Cheers for that

How do I check my locale ?

Ta

titopoquito 12-16-2008 05:48 AM

Quote:

Originally Posted by SmurfGGM (Post 3377201)
Cheers for that

How do I check my locale ?

Ta

Just type "locale" in a console window.

SmurfGGM 12-16-2008 06:15 AM

Thanks

For root I have

LANG=
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

All other users have ...

LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

And this is the settings that I need.

How do I change the settings for root ??

Ta

titopoquito 12-16-2008 04:26 PM

That may depend on your distribution. On Slackware you can set in by changing /etc/profile.d/lang.sh to change it systemwide. Another approach is to change root's .bashrc and/or .bash_profile if you are using BASH as shell; export for example LC_ALL=en_GB.UTF-8 in .bashrc and setup .bash_profile to load .bashrc if present. Or to come back to the distro problem, take a look at your distro's handbook/wiki etc.


All times are GMT -5. The time now is 09:07 AM.