) View the current user and user group in Linux

Source: Internet
Author: User

 Solemnly declare: This article is reproduced on the Internet by the author, and the ownership belongs to the original author!

Address: http://blog.chinaunix.net/uid-20648944-id-3190395.html

 

View the current Login User
$ Who
Loongson tty7 2012-04-27 08:58 (: 0)
Loongson pts/0 2012-04-27 (: 0.0)
Loongson pts/1 (: 0.0)
Loongson pts/2 (: 0.0)

$ Finger
Login Name TTY Idle login time office phone
Loongson tty7 12 Apr 27 08:58 (: 0)
Loongson pts/0 4 Apr 27 (: 0.0)
Loongson pts/1 Apr 27 (: 0.0)

View user information
$ Finger loongson
Login: loongson name: loongson
Directory:/home/loongson shell:/bin/bash
On since Fri Apr 27 08:58 (CST) on tty7 from: 0
13 minutes 52 seconds idle
On since Fri Apr 27 (CST) on pts/0 from: 0.0
5 minutes 50 seconds idle
On since Fri Apr 27 (CST) on pts/1 from: 0.0
No mail.
No plan

View User Groups
$ Groups loongson
Loongson: loongson ADM dialout CDROM plugdev lpadmin admin sambashare lib1_d

Add a user to a specified group:
# Usermod-a-g testgroup loongson

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.