Generally, you will find that the user name has been displayed at the console command prompt. However, some shells do not display your username by default, such as csh. Therefore, this command should be used on shell terminals that cannot display the user name back.How to run whoami
To run this command, you only need to enter whoami. In the following example, we use the csh shell terminal.
%
WhoAmI
Function Description:
Show user Name
Grammar:
WhoAmI
Supplementary Note:
Display the user name of oneself, this instruction is equivalent to execute id-un instruction
The difference between WhoAmI and who am I
The WHO command focuses on viewing current users who are logged on to this machine
The role of WHO-M is the same as that of who am I
Who a
Command function: Display information of logged-in userCommand format:Common options:Example:W shows the logged in user and the operation in progress[Email protected] ~]# W11:22:01 up 4 days, 21:22, 3 users, Load average:0.00, 0.00, 0.00USER TTY from [email protected] IDLE jcpu PCPURoot tty1-thu14 4days 0.19s 0.19s-bashRoot pts/0 172.31.3.32 Thu14 0.00s 0.73s 0.00s WRoot pts/1 172.31.3.32 11:18 1:50 0.07s 0.02s-bashWho shows the logged in username, terminal name, logon time, and login
Differences between linux who am I and whoami
Who am I displays the actual user name, that is, the user ID when the user logs on. This command is equivalent to who-m.
Whoami displays the valid user ID, the user name of the current "Operation user.
In most cases, the actual user ID is the same as the valid user ID.
Who-q is used to display the number of currently logged-on users.
If you think the output
In Linux, the WHO series commands exist who/whoami/who am I.First of all, I have an ordinary user guixian001 system. Then execute the command whoami/who am i/who to execute the command separately. As follows:650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/B9/wKioL1VRZYrjh8jCAACd9ikK2sU994.jpg "title=" Qq20150512102223.jpg "alt=" Wkiol1vrzyrjh8jcaacd9ikk2su994.jpg "/>We then use the SU command
WhoAmIFunction Description:Show user NameGrammar:WhoAmIAdditional notes:Display its own user name, this directive is equivalent to executing the id-un instructionThe difference between WhoAmI and who am I The WHO command is focused on seeing which users are currently logged on to this machineThe role of who-m and the role of Who am I is the sameWho am I displays the actual user's username, which is the user ID when the user logs in. This command is eq
The WHO, W, and WhoAmI commands can display logged-in user names, but usage and usage effects vary, so let's look at the usage of these three commands and their differences.1. Who command: Displays user information that is currently logged into the system and does not display the user's login via the SU command:[email protected] ~]# whoRoot Tty1 2015-08-19 16:23Root pts/0 2015-08-27 01:08 (192.168.1.254)Root PTS/1 2015-08-27 02:57 (192.168.1.254)2, W
Several common small commands for viewing logged-in users:1, W : Displays the currently logged on user and what they are doing[Email protected] usr]# W10:02:06 up 2 days, 2:06, 1 user, Load average:0.00, 0.00, 0.00USER TTY from [email protected] IDLE jcpu PCPURoot pts/0 10.109.134.247 Mon09 0.00s 0.40s 0.15s W2, WhoAmI display the current login system valid user name[Email protected] usr]# WhoAmIRoot3. Who shows which users are currently logged inWho-
]# Getfacl Inittab# File:inittab# Owner:root# Group:rootuser::rw-user:hadoop:rw-group::r--mask::rw-other::r--[Email protected] backup]#
WHOAMI: Displays the currently logged on user[Email protected] backup]# WhoAmIRoot[Email protected] backup]#Terminal (terminal, or physical terminal):is a device, not a program, typically a device that provides a command-line user interface, typically a screen and keyboard, or some other physical terminal
First, let's take a look at the different results of the three commands entered by common users and root users:
The difference is that whoami displays the User Name of the current "Operation user", while who am I displays the User Name of the "Login User.
The Linux term is as follows: (actual user = uid, that is, user ID. Valid user = EUID, I .e. valid user ID)
Who am I displays the actual user name, that is, the user ID when the user logs on. Thi
corresponding to dead processes.'-P ''--process 'List active processes spawned by Init.'-P ''--process 'List active processes spawned by Init.2. Slightly detailed results than WhoAmI'-M 'Same as ' Who am I '.3. Display the total number of users logged in'-Q ''--count 'Print only the login names and the number of users logged on.Overrides all other options.4. Other'--lookup 'Attempt to canonicalize Hostnames found in utmp through a DNSLookup. This isn
W who whoami last Lastb lastlog basename sleep hostname mail################################################W.H.O.WhoAmILast: Displays the/var/log/wtmp file, showing the user login history and System restart historyLastb:/var/log/btmp file that displays user error attempts to log onLastlog: Users who have never logged in################################################BaseName$: Script path and name when executing script################################
Display the user name. This command is equivalent to executing the "id-un" command.SyntaxWhoami [-- help] [-- version]Parameter description: -- Help online help. -- Version: displays the version information.InstanceShow user name# WhoamiRoot
Life goes on, go go go ...
Previously, there was a reference to the standard library provided by Golang: NET Package
Go Language Learning Net package (the path to go) brief aftertaste net package
func Parseip
Func Parseip (s string) IP
Parseip parses S as an IP address, returning the result. The string s can is in dotted decimal ("192.0.2.1") or IPv6 ("2001:db8:
IP subnet addressing
All Hosts must support subnet addressing (rfc950 [mogulandpostel1985]). IThe P address is simply composed of a network number and a host number. Instead, the host number is divided into a sub-network number and a host number.The reason for this is that Class A and Class B addresses allocate too much space for the master host number, and the number of hosts can be-2 and 21 respectively.6-2. In fact, there are not so many hosts in a
(1) The idea of modifying dynamic IP to static IP① back up the Ifcfg-eth0 file before modifying IP② Enter the NIC configuration directory/etc/sysconfig/network-scripts/ifcfg-eth0③ modifying Bootproto=static④ modifying Onboot=yes⑤ Configuring a static IP address ipaddr⑥ Configuring DNS NETMASK⑦ Configuring the Gateway G
Ubuntu 15.10 sets static ip Address Allocation fixed ip Address Settings dns settings gateway command line configuration ip fixed ip address does not take effect what to do, ubuntu15.10
Files to be used:
Configure Interface Information
/Etc/network/interfaces
Configuration content:
Auto eth0
Iface eth0 inet static
Addr
Files to use:Configuring interface Information/etc/network/interfacesConfiguration content:Auto Eth0Iface eth0 inet StaticAddress 192.168.216.188Gateway 192.168.216.2Netmask 255.255.255.0Configure DNS/etc/resolvconf/resolv.conf.d/baseConfiguration content: NameServer 192.168.216.2To view DNS:/etc/resolv.confCommand:View System Network InformationIfconfigRestart Network Service/etc/init.d/networking restartTake a look at your own local information (auxiliary only)Available IPNow automatically ass
How to bind lan ip addresses to MAC addresses, bind lan ip addresses and MAC addresses to prevent IP conflict attacksSo how can we protect lan network security and prevent LAN users from arbitrarily modifying IP addresses? I believe that you can disable IP address modificati
Php restricts access to ip segments, prohibits code sharing of ip submission forms, and ip forms. In php, you can restrict access to ip segments and prohibit code sharing in the ip address submission form. you can add the following code on the page where you want to prohibit
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.