1845886 Members
4447 Online
110250 Solutions
New Discussion

who -a and who -d

 
Wilfred Chau_1
Respected Contributor

who -a and who -d

Does anyone know the use of -a and -d option for who?

who -a

who -d

thanks
4 REPLIES 4
Geoff Wild
Honored Contributor

Re: who -a and who -d

man who

-a Processes /etc/utmp or the named file with all
options turned on.


-d This option displays all processes that have
expired and have not been respawned by init. The
exit field appears for dead processes and contains
the termination and exit values of the dead
process (as returned by wait() - see wait(2)).
This can be useful in determining why a process
terminated.


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Mel Burslan
Honored Contributor

Re: who -a and who -d

who -d shows you the who is logged on from which terminal and at what time

who -a has more detailed information about the people who are logged in, like time they are online at this connection, their shells' PID and the hostname/ipaddress they are connecting from.

It is all upto you how you want to use that information.
________________________________
UNIX because I majored in cryptology...
Wilfred Chau_1
Respected Contributor

Re: who -a and who -d

both commands return not only username but also some processes. In the below, d is for dead processes and a is turning on all options.

what is dead processes?

Usage: who [-rbtpludAasHTqRm] [am i] [utmp_like_file]

d dead processes
a all (rbtpludA options)

Ermin Borovac
Honored Contributor

Re: who -a and who -d

My guess is that dead process is an entry in /etc/utmp ('who' gets information from this binary file) whose PID does not correspond to a currently running process.

Upon login terminal emulators create an entry in /etc/utmp and on exit they mark the entry as dead process. Dead process utmp entries can be recycled by new processes.