The OS X command 'who' is used to view and print user information. Use who to print all usernames logged in, and you will be able to view all current system users, the log in name for each, the time of the user's log in, the date of the user's log in, her tty name and the hostname if she is not on a local machine.
Use Who to Print All Usernames Logged In
Step1 Learn the basic command line options for the who command. They are fairly intuitive and extremely useful.
Step2 Use '-m' to view and print information for a specific terminal. In POSIX, this is the same as 'who am i'.
Step3 Use '-u' to view and print the time each user spends idle. This is a very commonly used option and can be used to estimate productivity of your employees.
Step4 Use '-T' for terminal line state. This will print characters like '+' for a writable terminal and '?' when an error is encountered. What this means is that users with a '+' allow messages, users with a '-' disallow and '?' means the device cannot be located.
Step5 Use '-H' to help you organize your data. It will insert column headings above the output, making your data easier to read.
Step6 Type 'am i' if you want to know the real name of a user.
Step7 Use file to specify where you want who to gather information from. Typically, who will use the file /var/run/utmp. However, many organizations find it useful for who to gather data from /var/log/wtmp. /var/log/wtmp is often preferred, because wtmp records all logins, logouts, shut downs, date changes and system crashes. It provides a wealth of useful information.
Step8 Use '-l' as an alternative look-up tool. It is not always used because of its unfortunate trait of causing dial-up delay.
Step9 Use '-s' to ignore.
Step10 Use '-q' to obtain the most basic information. This is one you'll probably use a lot, because it returns the current number of users logged in along with their usernames.
Step11 Check ss.64.com for a list of who command line options (see Resources below).
How to Use Who to Print All Usernames Logged in
tags: Linux | author: chaoPosts Relacionados:
Subscribe to:
Post Comments (Atom)
0 comment:
Post a Comment