From: peter@abbnm.com (Peter da Silva)
Subject: Re: Last command output format
Date: Fri, 27 Feb 2004 17:13:25 +0000 (UTC) [thread overview]
Message-ID: <c1ntrl$1q6l$1@jeeves.eng.abbnm.com> (raw)
In-Reply-To: 9bc9c9cd.0402260631.3ca837fa@posting.google.com
In article <9bc9c9cd.0402260631.3ca837fa@posting.google.com>,
Claude <claude.plouffe@ec.gc.ca> wrote:
> I would like to know if it is possible to reformat the output
> generated by the last command?
The "last" command dumps out records from the file "/var/adm/wtmp". These
records are in "utmp" format.
% man utmp
[...]
The utmp file records information about who is currently using the system.
The file is a sequence of utmp entries, as defined in struct utmp in the
utmp.h file.
[...]
% cat /usr/include/utmp.h
[...]
struct utmp {
char ut_user[32]; /* User login name */
char ut_id[14]; /* /etc/inittab id- IDENT_LEN in init */
char ut_line[32]; /* device name (console, lnxx) */
short ut_type; /* type of entry */
[...]
time_t ut_time; /* time entry was made */
char ut_host[64]; /* host name same as MAXHOSTNAMELEN */
};
> The host field is truncated to 16 char where in fact it is a 256 char
> field. My host names are longer than 16 characters.
64 char, actually.
> Is there another command I can use (perl script maybe) ?
That should be enough to get you started.
--
I've seen things you people can't imagine. Chimneysweeps on fire over the roofs
of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All
these things will be lost in time, like chalk-paintings in the rain. `-_-'
Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`
next prev parent reply other threads:[~2004-02-27 17:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-26 14:31 Last command output format Claude
2004-02-27 17:13 ` Peter da Silva [this message]
2004-02-27 22:51 ` Brian Haley
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox