LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-06-2012, 11:20 AM   #1
redhat70
Member
 
Registered: May 2012
Posts: 86

Rep: Reputation: Disabled
DATE Display command needed...


Hi,

drwxr-x--- 4 root root 4096 Jul 6 11:35 bin
drwxr-x--- 3 root root 4096 Jul 6 11:35 cit
-rw-r----- 1 root root 98 Jul 6 11:35 FILE_ID.DIZ
drwxrwxrwx 2 root root 4096 Jul 6 11:35 logs
drwxr-x--- 2 root root 4096 Jul 6 11:35 nls
drwxr-x--- 4 root root 4096 Jul 6 11:35 scanner
drwxrwxrwx 2 root root 4096 Jul 6 11:35 upload

In the Output, Their is No YEAR display .

Can anybody give me the command to Display the YEAR Also along with the Date and Month of th File created .

I can see JUL 6, But their is no YEAR display.

So, Please help me the command which can show the YEAR as weel along with the Date.

Regards,
Aparna.
 
Old 10-06-2012, 11:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
The ls command has some options that might be handy:
Code:
ls -l --time-style=long-iso
The long-iso keyword can be one of several, check the ls man page.

EDIT:

Some other examples to get you going:
Code:
ls -l --time-style=+%c
ls -l --time-style=+%F
ls -l --time-style="+%b %d %Y"
The format options can be found in the date man page.

Last edited by druuna; 10-06-2012 at 11:41 AM. Reason: added examples
 
Old 10-08-2012, 08:45 AM   #3
redhat70
Member
 
Registered: May 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
Thanks a Lot for responding to my query.
 
Old 10-08-2012, 09:13 AM   #4
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,479
Blog Entries: 6

Rep: Reputation: Disabled
Code:
ls --time-style="+%b %d %Y %l:%M %p"  --color=auto
gives me this output:
Code:
drwxr-xr-x  4 jj users 4.0K Oct 08 2012 10:00 AM Bin/
drwxr-xr-x  2 jj users 4.0K Sep 07 2012  5:30 PM Desktop/
drwxr-xr-x  5 jj users 4.0K Oct 05 2012  9:24 PM Documents/
drwxr-xr-x 15 jj users 4.0K Oct 06 2012  5:00 PM Downloads/
drwxr-xr-x 16 jj users 4.0K Dec 18 2011  5:37 PM Music/
drwxr-xr-x  5 jj users 4.0K Jul 23 2012  7:57 PM Pictures/
drwxr-xr-x  2 jj users 4.0K May 06 2012  6:54 PM Public/
drwxr-xr-x  2 jj users 4.0K Dec 15 2011  9:18 PM Templates/
drwxr-xr-x  2 jj users 4.0K Mar 05 2012  8:39 AM Videos/
drwxr-xr-x  5 jj users 4.0K Sep 22 2012  9:52 PM VirtualBox VMs/
Just another method...

HTH.
 
Old 10-10-2012, 02:50 PM   #5
redhat70
Member
 
Registered: May 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
Hi,

Thanks for sharing the command.

i want to know,is their any other command alternate to :

/etc/redhat-release to fetch the Linux version ?
 
Old 10-10-2012, 02:52 PM   #6
redhat70
Member
 
Registered: May 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
Hi,

# ls -l --time-style="+%b %d %Y %l:%M %p" --color=auto

their was no -l option in your output.

So i have added it.
 
Old 10-11-2012, 02:16 AM   #7
kamran.ayub
Member
 
Registered: Jan 2012
Posts: 45

Rep: Reputation: Disabled
redhat release

For alternative of
cat /etc/redhat-release

you may use
cat /etc/issue
 
Old 10-11-2012, 03:32 AM   #8
Rupadhya
Member
 
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Rep: Reputation: Disabled
I use Fedora, so I don't know if this works on Redhat, but to tell what kernel I am using I type
# uname -a
Linux rajhome2 3.6.1 #1 SMP Thu Oct 11 02:17:09 CDT 2012 i686 i686 i386 GNU/Linux

Does that help?

- Raj
 
Old 10-13-2012, 03:15 PM   #9
redhat70
Member
 
Registered: May 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
Hi,

what does this output means :

# cat /etc/issue
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Kernel \r on an \m


===================================

I want to know, what does Kernel \r on an \m ?

What does this mean ?

Your help is highly appreciable...

Thank you in advance.

Regards,
Aparna.
 
Old 10-13-2012, 03:49 PM   #10
Rupadhya
Member
 
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Rep: Reputation: Disabled
Quote:
Originally Posted by redhat70 View Post
Hi,

what does this output means :

# cat /etc/issue
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Kernel \r on an \m


===================================

I want to know, what does Kernel \r on an \m ?

What does this mean ?

Your help is highly appreciable...

Thank you in advance.

Regards,
Aparna.

Must be some kind of substitution that isn't happening. Can you do a
Code:
uname -a
at a command prompt? The -a option means all.
- Raj
 
Old 10-13-2012, 03:54 PM   #11
redhat70
Member
 
Registered: May 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
#uname -a

Linux LOPASCO2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
 
Old 10-13-2012, 10:07 PM   #12
Rupadhya
Member
 
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Rep: Reputation: Disabled
I think that means you are running a Linux system with the 2.6.18-128.el5 kernel, compiled on Wed Dec 17 11:41:38 EST 2008 for the x86_64.
- Raj
 
Old 10-15-2012, 09:17 PM   #13
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
In general I find that
Code:
cat /etc/*release*
works on most distros.
Unfortunately there are distro dependent variations on the exact name of that file.

As you can see from the above, this gives you the distro version, uname gives you the kernel info.

For those that implement it, lsb_release may work.
 
Old 10-16-2012, 01:00 AM   #14
Rupadhya
Member
 
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Rep: Reputation: Disabled
I found this script somewhere. I am not sure where but, you can save it as ver_linux and then chmod+x ver_linux.
From the directory you have it saved in you can execute it by ./ver_linux.

Here it is...
Code:
#!/bin/sh
# Before running this script please ensure that your PATH is
# typical as you use for compilation/istallation. I use
# /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
# differ on your system.
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
echo 'If some fields are empty or look unusual you may have an old version.'
echo 'Compare to the current minimal requirements in Documentation/Changes.'
echo ' '

uname -a
echo ' '

echo "Gnu C                 " `gcc --version`

make --version 2>&1 | awk -F, '{print $1}' | awk \
      '/GNU Make/{print "Gnu make              ",$NF}'

ld -v 2>&1 | awk -F\) '{print $1}' | awk \
      '/BFD/{print "binutils              ",$NF}'

fdformat --version | awk -F\- '{print "util-linux            ", $NF}'

mount --version | awk -F\- '{print "mount                 ", $NF}'

insmod -V  2>&1 | awk 'NR==1 {print "modutils              ",$NF}'

tune2fs 2>&1 | grep "^tune2fs" | sed 's/,//' |  awk \
'NR==1 {print "e2fsprogs             ", $2}'

reiserfsck 2>&1 | grep reiserfsprogs | awk \
'NR==1{print "reiserfsprogs         ", $NF}'

cardmgr -V 2>&1| grep version | awk \
'NR==1{print "pcmcia-cs             ", $3}'

pppd --version 2>&1| grep version | awk \
'NR==1{print "PPP                   ", $3}'

isdnctrl 2>&1 | grep version | awk \
'NR==1{print "isdn4k-utils          ", $NF}'

ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
-e 's/\.so$//' | awk -F'[.-]'   '{print "Linux C Library        " \
$(NF-2)"."$(NF-1)"."$NF}'

ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1 | awk \
'NR==1{print "Dynamic linker (ldd)  ", $NF}'

ls -l /usr/lib/lib{g,stdc}++.so  2>/dev/null | awk -F. \
       '{print "Linux C++ Library      " $4"."$5"."$6}'

ps --version 2>&1 | awk 'NR==1{print "Procps                ", $NF}'

ifconfig --version 2>&1 | grep tools | awk \
'NR==1{print "Net-tools             ", $NF}'

# Kbd needs 'loadkeys -h',
loadkeys -h 2>&1 | awk \
'(NR==1 && ($3 !~ /option/)) {print "Kbd                   ", $3}'

# while console-tools needs 'loadkeys -V'.
loadkeys -V 2>&1 | awk \
'(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools         ", $3}'

expr --v 2>&1 | awk 'NR==1{print "Sh-utils              ", $NF}'

if [ -e /proc/modules ]; then
    X=`cat /proc/modules | sed -e "s/ .*$//"`
    echo "Modules Loaded         "$X
fi
It checks a bunch of things for building software. I have run it a couple of times.

- Raj

Last edited by Rupadhya; 10-16-2012 at 01:01 AM. Reason: Deleting some extra characters that found their way in the paste.
 
  


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
Bash History: Display Date And Time For Each Command JATA01 Linux - Server 15 07-19-2013 07:05 AM
CentOS Display Problems, your display needs tweaking, here you go, no xrandr needed.. damiank Linux - Desktop 0 08-09-2012 02:14 AM
Why does date always display utc? cmnorton Ubuntu 2 05-23-2008 10:01 AM
display date user52 Linux - Newbie 2 11-28-2006 07:20 AM
Date display in Thunderbird kbcnetau Linux - Software 5 04-08-2005 08:27 PM


All times are GMT -5. The time now is 05:15 AM.

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