Your First Linux Commands: pwd, whoami and uname
Three commands can answer the first questions you should ask in a new Linux session: Where am I in the filesystem? Which user am I acting as? Which kernel is running? Run them one at a time as a normal user. No administrator access is needed.
Where am I? — pwd
Possible output: /home/learner. The current working directory is the location from which relative file names are interpreted. Your home directory is a personal storage location; the current working directory may be somewhere else. In Bash, pwd is normally a builtin.
Imagine that your home directory contains a folder named Documents. When that folder becomes your working directory, an unqualified filename is interpreted relative to Documents, not the home directory. Printing the working directory is a way to check this context before operating on files.
Who am I? — whoami
Possible output: learner. This is the name associated with your effective user ID, not necessarily your original login name. If it prints root, you have a privileged identity in that environment; switch back to a normal lab session before continuing.
Which kernel? — uname
The first command should print Linux; the second prints the running kernel release, which varies with system and update history. These commands do not tell you the distribution release. Use /etc/os-release from the earlier lesson for distribution identity.
Make a small orientation report
printf '%s\n' 'Working directory:'pwdprintf '%s\n' 'Effective user:'whoamiprintf '%s\n' 'Kernel:'uname -sThe output alternates labels and values: a path, a user name and Linux. Values depend on your session. This report only reads information; it does not save to disk. If sharing results, replace personal names and paths with fictional values.
Common mistakes and next practice
Do not assume pwd always prints the home directory, whoami always prints your login name, or uname -r prints the Ubuntu release. If a command is not found, check you are in the intended Linux environment; command lookup will be covered next. Run the report and explain which value changes when you enter another directory, which identifies your effective user, and which stays the kernel name.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Your first Linux commands — Knowledge Check
Apply the core ideas and safe practices from this lesson.
Which command identifies your current working directory?
whoami returns root in your beginner lab. What should you do?
Which command reports the kernel release rather than the distribution version?
You move from /home/learner to /tmp without changing identity. Which result should change?