Last Command not giving year


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Last Command not giving year
# 1  
Old 10-14-2008
Java Last Command not giving year

Hi All,

i want the last login details along with year.

i tried below command but not giving me the year of last login.

last <$Userid> | head -1

i heard that if it is current year then it wont display the year else it will display the year. is it so?
if yes then , is there any way of even displaying even year for the current year?

can any one please help me in this?

Regards,
Ananda
# 2  
Old 10-14-2008
It doesnot have an option to give you the year.

I cannot confirm that it ever shows any year. I have a log on one of my HP-UX servers that I know has over 1 year of data and it doesnt show the year anywhere.
I know this could caus some problems with some of our monitoring scripts at the end of the year. But would only be a problem for a short time, as I use tail command to only read the last 400 or so from the log. So if its january and I see december that would probabally be from last year. :P
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Insert year in ls -l command

Hi All, Have a file where i stored ls -l command output, -rw-r--r-- 1 360 600 94255 Jan 01 11:16 file1_2020.csv -rw-r--r-- 1 360 600 114573 Dec 29 11:10 file2_2019.csv -rw-r--r-- 1 360 600 41006 Dec 30 11:09 file3_2019.csv -rw-r--r-- 1 360 ... (9 Replies)
Discussion started by: kumarinfa
9 Replies

2. Shell Programming and Scripting

Grep command giving different result for different users for same command

Hello, I am running below command as root user #nodetool cfstats tests | grep "Memtable switch count" Memtable switch count: 12 Where as when I try to run same command as another user it gives different result. #su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies

3. AIX

Lsof command giving while loop

Hello, There is a process in AIX which is actually a oracle database user session but is running very slow When I use lsof it give below output lsof /proc/21955180 In while loop:256 In while loop:256 In while loop:256 In while loop:256 Value of I :183 np:1024 Please... (1 Reply)
Discussion started by: Vishal_dba
1 Replies

4. Emergency UNIX and Linux Support

LAST command with Year

Hi Guys, I'm trying to identify the last logins by all the users in the system in AIX. the last command gives me the output, but there is no year displayed for it . Since there is a duplication of months i mean Apr 2010 and Apr 2009 also its giving me inaccurate data.. Is there a way I can filter... (4 Replies)
Discussion started by: kkeng808
4 Replies

5. Shell Programming and Scripting

tr command giving wrong output

Hi All, i have a file which have many fields delimited by ,(comma) now i have to show only few fields and not all. the sample text file looks like this: TYPE=SERVICEEVENT, TIMESTAMP=05/06/2009 11:01:40 PM, HOST=sppwa634, APPLICATION=ASComp, FUNCTION=LimitsService, SOU... (8 Replies)
Discussion started by: usha rao
8 Replies

6. Shell Programming and Scripting

simulation of wc command giving problems

Hello, i am developing a simple shell script for simulation of wc command but it's not working.Please tell me what is the problem. I have commented the problematic line if then echo "<Improper Usage>" echo "wcassg <options> file" else eval file=\$$# if then chars=0 words=0... (2 Replies)
Discussion started by: salman4u
2 Replies

7. UNIX for Dummies Questions & Answers

Last Command not giving year

Hi All, i want the last login details along with year. i tried below command but not giving me the year of last login. last <$Userid> | head -1 i heard that if it is current year then it wont display the year else it will display the year. is it so? if yes then , is there any way of... (1 Reply)
Discussion started by: ani_rvce
1 Replies

8. Linux

Terminal Execution By Giving a Command

Hi Guys, I am using Red Hat Linux 5 and GNOME Terminal is available there in the Accessories menu of Applications. But I don't see any run command option which can be used to type the name of the terminal and execute it directly as I used to do it under Mandrake Linux wherein I would type... (2 Replies)
Discussion started by: indiansoil
2 Replies

9. Solaris

^p not giving command line history.

I am used to using "set -o emacs" and then using "CNTL-P" for getting previous commands in solaris but on one host it does not work and instead just makes a DONG!! # ksh # set -o emacs # ls # ^p Can anyone offer guidance as to why this is? Thank you my friends. akbar (0 Replies)
Discussion started by: akbar
0 Replies

10. UNIX for Dummies Questions & Answers

listing year in ls command

Hi all .. As per rule i searched the forum i am not able found out ... I want to display the year in when listing the files .. when i use ls -lt it is not displaying files with recent 6 month old .. I know that perderabo has written a script for that if you give that link it will be... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
Login or Register to Ask a Question