The "whoami" command should show you what account you are currently using.
The tilde character (~) is a shortcut for the home directory of the currently logged-on user.
Use the 'who', 'w', or 'users' command to find out who is logged in.
The command "finger" can tell you how many active shells are used, the users logged in, and where they logged in.
User History
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).
Type the following command# ls -l
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.
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.
Default 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.
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.
#!/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