Help me with command in linux
1 Attachment(s)
Let me ask you use who command if I only want to show only the username and login now how I have:D:D:D
|
The login name is displayed on the very left side.
If $ is displayed, you are logged in as user. If # is displayed, you are logged in as root. |
I want to filter condition show who command to display only the login names and hours logged
|
Quote:
I guess... That you want to display some info exclusively... So: 1. man man.... USE MAN... man who => Why ? Because OFTEN an argument does what you want. 2. then: "man whatever-you-need"... 3. finally LEARN: grep, sed, awk, Bash (or eq).... Grep/sed helps you to filter text... awk kinda-parse records.. Good luck. Garry. PS/ $ who -s ?? |
Code:
man who |
Expand the question
Agree with above, your meaning is unclear.
Do you mean you want the logon name and time for the users currently logged in? That can be pulled in several ways, and filtered in several ways to avoid displaying what you do NOT want. I have a snip that may be useful: Code:
#!/bin/bash Using that I might try Quote:
Please let us know is that helps. If not, please provide more detail about your question and need. |
Quote:
Code:
who | awk '{ print $1, $4 }' Code:
who | awk 'BEGIN { printf "%-19s" "%-9s\n", "User", "Login Time" } { printf "%-19s" "%-7s\n", $1, $4 }' Code:
w Another command is last. You can use this command to see current and passed logins. There you have it. who, w, and last. Enjoy! |
I think he want who am i with hours logged
OK |
Quote:
|
waiting ...
I think that at this point we need to wait for the OP to fill us in on what he really needs. We have offered a couple of possible answers to the question he almost asked, and without clarification we are just spinning our wheels. We need direction, and the OP can provide that.
|
Quote:
As mentioned earlier, Op can try w and last to get additional information on logins. There is another approach called process accounting. It logs users logins and length of time and what they did, etc. The package name is call psacct the command is ac |
Well in fact looking at his other posts, it seems he's a lamer... Asking here for us doing his homework for free...
Of course as he can't speak minimal English, don't expect any gratitude :). |
Quote:
|
All times are GMT -5. The time now is 10:04 PM. |