answersLogoWhite

0


Best Answer

The "whoami" command should show you what account you are currently using.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you find out what user you are logged in as in Linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What Linux character can also be used to refer to the current user's home directory?

The tilde character (~) is a shortcut for the home directory of the currently logged-on user.


Shell program to show the user name of the user who has logged-into the system?

Use the 'who', 'w', or 'users' command to find out who is logged in.


How do I find out how many different login shells are used in my Linux?

The command "finger" can tell you how many active shells are used, the users logged in, and where they logged in.


Can I find whether anyone has logged into my system in my absence?

User History


What is the use of the whoami command in Linux?

To see what user you are logged in as. Not all shells will display the username you are logged in under, so it is useful to know if you are a normal user (so you don't have to worry about accidentally destroying your system), or root (so you don't screw up your personal files by modifying them as root).


How do you find user permissions in Linux?

Type the following command# ls -l


In linux. Which prompt does the root user receive when logged in to the system?

Typically a root user sees the '#' symbol as their prompt. If they already have a prompt via the PS1 shell variable then the # symbol is usually added at the end to indicate that they are a root user in this current context.


Who or what is the user called Anonymous on WikiAnswers?

Anonymous is not an actual user, but rather an alias for anyone who contributes to WikiAnswers while not logged in. If the website says "Anonymous" did something, it really means that a user who was not logged in did it. For example, a question asked by "Anonymous" is a question that was asked by a user who is not logged in.


Is the default user the profile that is merged into each user profile when the user is logged on?

Default user


Is Linux a milti user or single user?

The last answer to this was incorrect. Whether or not you are the only user on the system or not: Linux is always a multi-user operating system.


Find if the entered user has logged in or not?

ls -l|tail +2|tr -s " "|cut -d " " -f2,9|sort -n|tail -1 An easier way would be to use the 'finger' command - it will tell you when the user last logged in.


Write a unix shell program to accept a user name and check whether the user logged in or not?

#!/bin/sh echo "Please enter the name of a user:" read USER who|grep $USER > /tmp/usertest & sleep 5 if [ -s /tmp/usertest ] then echo "User is logged in" else echo "User is not logged in" fi rm /tmp/usertest