Here, `whoami` and `id -un` show the same account name. I love how that small equivalence makes the scope of `whoami` clear without turning it into a full account profile.
Compare the question you have with the value each command reports. That distinction helps you choose between `uname` and `whoami`.
What uname and whoami tell you
uname prints selected information about the running kernel and machine. whoami prints the account name associated with the process’s effective user ID.
They answer separate questions, so choose by the value you need.
| Command | What it identifies | Example use |
|---|---|---|
| uname | Kernel name, when you give no option | Check whether the kernel reports Linux |
| uname -r | Kernel release | Compare a release with a driver requirement |
| whoami | Effective user name | See which account a process runs as |

The image shows the default kernel-name result, Linux. It does not identify the kernel release or the distribution.
Confirm both commands are available
Both commands run from a shell and need no administrative rights, so the first check is whether your shell can locate them. The command below looks up both names.
command -v uname whoami
The output contains one executable path per command. If either path is absent, that command is unavailable in your current PATH.
Select the uname field you need
With no option, uname acts as though you passed -s. The uname manual lists the fields and their order, so use the table to select one field or the full set.
I found uname -r clearer for a kernel-release question than uname -a because its single value can be compared on its own.
| Option | Information printed |
|---|---|
| -a, –all | All known fields together, with -p and -i omitted when unknown |
| -s, –kernel-name | Kernel name |
| -n, –nodename | Network node name, commonly the host name |
| -r, –kernel-release | Kernel release |
| -v, –kernel-version | Kernel version string |
| -m, –machine | Machine hardware name |
| -p, –processor | Non-portable processor type, which may be unknown |
| -i, –hardware-platform | Non-portable hardware platform, which may be unknown |
| -o, –operating-system | Operating-system name |
uname -a
Use -r when you need the kernel release. Use -v for the kernel’s version string, which is a different field.
uname -r

The displayed release belongs to the kernel running on that machine. Your system prints its own value.
Check the effective user with whoami
whoami prints the name attached to the current effective user ID. The whoami manual says its output is the same as id -un, which means both commands name the same effective account.
I saw both commands return the same account name in this shell, so the command and its documented equivalent agree.
whoami
id -un

The printed name does not include group membership, so run id when groups can explain a permission result. For the next step, see how to find a user’s group in Linux or list all groups in Linux.
The account name alone does not show its sudo policy, so treat whoami as an identity check rather than a permission check. If you need to grant access, follow the guide to add a user to sudoers.
If you need another account, use useradd to create a Linux user. To rename an existing Ubuntu account, follow the steps to change a username on Ubuntu.
Separate login records from kernel and distribution details
whoami answers which effective account the process uses. The commands who and who am i query login-session records instead, while uname -r reports the kernel release.
| Question | Command | What the result means |
|---|---|---|
| Which account does this process use? | whoami | Effective user name |
| Which users have login sessions? | who | Records of logged-in users |
| Which login record belongs to this terminal? | who am i | Terminal login entry, when one is recorded |
| Which IDs and groups does this process have? | id | User ID, group ID, and group membership |
| Which kernel release is running? | uname -r | Kernel release string |
| Which Linux distribution is installed? | cat /etc/os-release | Distribution name and version fields |
I saw who am i return no line in this terminal, which fits the who manual because it reads the terminal’s login information from utmp.
cat /etc/os-release

The command reads the distribution’s os-release file, not a uname field. Its os-release manual describes the distribution name and version fields, while the Ubuntu version check shows that procedure on Ubuntu.
Use the field the next tool needs
When a permission result depends on the account’s groups, inspect those IDs before changing permissions. I use id for that next check because whoami intentionally returns only the effective account name.
id
Frequently asked questions
The login name recorded for a terminal can differ from a process’s effective user ID. The command you choose determines which identity you see.
What does uname print without any options?
Without an option, uname prints the kernel name. On a Linux kernel, that value is Linux.
Does whoami show the logged-in user?
whoami prints the name associated with the process’s current effective user ID. It does not report the terminal’s login record.
Does uname -r show the Linux distribution version?
No. uname -r prints the running kernel’s release. Read /etc/os-release for the Linux distribution name and version fields.
