LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-16-2008, 06:32 AM   #1
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 39

Rep: Reputation: 0
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 !
 
Old 12-16-2008, 06:40 AM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,455

Rep: Reputation: 83
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!
 
Old 12-16-2008, 06:42 AM   #3
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 39

Original Poster
Rep: Reputation: 0
Cheers for that

How do I check my locale ?

Ta
 
Old 12-16-2008, 06:48 AM   #4
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,525

Rep: Reputation: 94
Quote:
Originally Posted by SmurfGGM View Post
Cheers for that

How do I check my locale ?

Ta
Just type "locale" in a console window.
 
Old 12-16-2008, 07:15 AM   #5
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 39

Original Poster
Rep: Reputation: 0
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
 
Old 12-16-2008, 05:26 PM   #6
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,525

Rep: Reputation: 94
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script to find modified date and last accessed date of any file. parasdua Linux - Newbie 6 04-22-2008 10:59 AM
Setting system date and time affecting the clock and date on BIOS satimis Ubuntu 7 09-21-2007 09:02 AM
what is the correct syntax order for tar with --after-date DATE, --newer DAT farhan Linux - General 1 03-16-2007 09:43 AM
showing date using pipe pintu_052 Linux - General 2 06-04-2006 04:32 AM


All times are GMT -5. The time now is 11:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration