LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 05:32 AM   #1
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 49

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, 05:40 AM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,832

Rep: Reputation: 108Reputation: 108
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, 05:42 AM   #3
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 49

Original Poster
Rep: Reputation: 0
Cheers for that

How do I check my locale ?

Ta
 
Old 12-16-2008, 05:48 AM   #4
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,645

Rep: Reputation: 146Reputation: 146
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, 06:15 AM   #5
SmurfGGM
Member
 
Registered: Jul 2008
Posts: 49

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, 04:26 PM   #6
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,645

Rep: Reputation: 146Reputation: 146
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



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 09:59 AM
Setting system date and time affecting the clock and date on BIOS satimis Ubuntu 7 09-21-2007 08:02 AM
what is the correct syntax order for tar with --after-date DATE, --newer DAT farhan Linux - General 1 03-16-2007 08:43 AM
showing date using pipe pintu_052 Linux - General 2 06-04-2006 03:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration