jcob_l
asked on
username
echo %USERNAME%
we use in windows
what is it's equivalent in linux..
Please help.
we use in windows
what is it's equivalent in linux..
Please help.
well to be exact 'whoami' is a command.
If you want exactly the same thing you have above (a system veriable which holds the current username) then it would be
echo $USER
(note the capital letters)
If you want exactly the same thing you have above (a system veriable which holds the current username) then it would be
echo $USER
(note the capital letters)
ASKER
[root@server2 dbs]# echo $USER
root
[root@server2 dbs]#
root
[root@server2 dbs]#
yes. See the word 'root' at the start of lines 1 and 2.... thats your username.
See the '#' at the end of those lines.... that also means you are 'root'
root is your username.
Is that not what you want ?
See the '#' at the end of those lines.... that also means you are 'root'
root is your username.
Is that not what you want ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not related (i.e. please no assist for this), but if you're new to Linux something you should be aware of... the more stuff you do at root level, the more ownerships and permissions will get tied to it until eventually your setup won't run withOUT using 'su -' for root (most distros by default no longer allow "logging in" as root for just that reason).
So it's much better to do 'su' + root password, or put the user in the /etc/sudoers file and use 'sudo' + user password (as edster9999 mentioned in http:#a39526099).
So it's much better to do 'su' + root password, or put the user in the /etc/sudoers file and use 'sudo' + user password (as edster9999 mentioned in http:#a39526099).
Check $PS1
answer is there itself.
answer is there itself.
ASKER
yes that is correct with sudo.
http://unixhelp.ed.ac.uk/CGI/man-cgi?whoami