In the mean time I have written one script which will give me the users last login in the system ( All users )
In the above I want to execute the first line command highlighted below as root using sudo..
ssh unadm@$1 ' lsuser -a time_last_login ALL | sed 's/\ time_last_login=/:/g' > /userlogins
Can anyone explain how can i use sudo in this remote command
---------- Post updated 06-17-10 at 12:30 AM ---------- Previous update was 06-16-10 at 07:50 PM ----------
Hi,
I understand that the ls command with "-l" option generates the "last modified time" of specific directory.
However, some generated results displayed the "last modified time" with detail about the last modified year, for example:
-rwxrwxrwx+ 1 smith dev 10876 May 16 2005 part2
... (6 Replies)
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)
Hi,
When retrieving parameters of a file using ls command i need to print the year part . When i do ls -ltr the following output is displayed
-rwxrwxrwx 1 d_infd d_infd 1711 Jan 8 2004 wf1.class.
Here the year part is not displayed only Jan 8 is displayed.
Can any one... (9 Replies)
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)
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)
What is the uptime command output when the server is running more than one year?
My doubt is whether it show in number of days format or number years and number of days format?
For example, Assume the server is running 400 days 3 hrs 3 min 3 secs. The output like 400 days 3:3 min or 1 year 5... (3 Replies)
Hi all,
Need an urgent help on the below scenario.
script:
awk -F","
'BEGIN { #some variable assignment}
{ #some calculation and put values in array}
END {
year=#getting it from array and assume this will be 2014
month=#getting it from array and this will be 05
date=#... (7 Replies)
hi all,
I use
date +%Y
which gives Current year.
Requirement: I want previous year to be printed. Please help me.
Note: I tried
date +%d/%m/%Y -d "-1 years" which is not working. (10 Replies)
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
LEARN ABOUT OSF1
last
last(8) System Manager's Manual last(8)NAME
last - Displays information about previous logins
SYNOPSIS
/usr/bin/last [-n maxlines | -maxlines] [-f filename] [name...] [tty...]
FLAGS
Reads information about previous logins from filename instead of from the accounting file /var/adm/wtmp. Limits the output to maxlines
number of record lines. Limits the output to maxlines number of record lines. Provides SVID conformance, and is equivalent to -maxlines.
DESCRIPTION
The last command displays, in reverse chronological order, all previous logins and logouts entered in the currently active /var/adm/wtmp
file. The list of output records can be restricted to maxlines number of record lines if the -maxlines or the -n maxlines flag is speci-
fied. The last command also displays logins and logouts by the user specified with the name parameter, and logins and logouts from termi-
nals specified with the tty parameter. The tty terminal references can be fully named (for example, tty0) or abbreviated (for example, 0).
For each process, the following information is displayed according to session, with the most recent session listed first: Time session
began Duration of session The tty terminal on which session took place
The following information is included when applicable: Terminations when rebooting Continuing sessions
If the last command is interrupted, an indication of how far the search has progressed in the /var/adm/wtmp file is provided. If the com-
mand is interrupted by a quit signal, an indication as to how far the search has progressed is provided, but the search continues.
To obtain information about the mean time between reboots, use the word shutdown as the name parameter.
EXAMPLES
The following example displays all recorded logins and logouts for user root and all recorded logins and logouts from the console terminal:
last root console The following example displays the time between system reboots: % last shutdown shutdown ~
Fri Aug 28 17:59 shutdown ~ Mon Aug 17 09:07
wtmp begins Mon Aug 17 08:51 In the previous example, the shutdown pseudouser is used to list the mean time between system reboots.
FILES
Specifies the command path. Header file defining structures used to organize login information. The login/logout database file.
RELATED INFORMATION
Commands: lastcomm(8)
Files: utmp(4), wtmp(4). delim off
last(8)