Linux Quiz: Test Your Linux Basics, Users and Groups
This Linux quiz helps you check what you know about the Linux command line before an exam, an interview or your first job on a server. There are two short quizzes on this page, plus a revision guide with the commands and facts they test.
The first quiz covers Linux basics: files, directories, paths, permissions and everyday commands. The second covers users and groups: creating and removing accounts, group membership and the files that store this information.

How to use this Linux quiz
Each question has one correct answer, and you see your score at the end. For the best results:
- First, take each quiz without looking anything up.
- Then note the questions you got wrong.
- Next, read the revision notes below and the linked guides.
- Finally, retake the quiz a day later to check that the knowledge stuck.
Aim for at least 80% before an interview. If you score lower, start with Linux fundamentals and basic commands.
Linux Basics Quiz
Linux Users and Groups Quiz
Revision notes: Linux basics
Paths and navigation
An absolute path starts at the root directory, for example /etc/ssh/sshd_config. A relative path starts from your current directory, for example ../logs. In addition, ~ means your home directory, . means the current directory and .. means the parent.
| Command | What it does |
|---|---|
pwd | Prints the current directory |
ls -la | Lists all files, including hidden ones, with details |
cd /var/log | Changes to a directory |
mkdir -p a/b/c | Creates nested directories |
cp -r src dst | Copies a directory recursively |
mv old new | Moves or renames a file |
rm -r dir | Removes a directory and its contents (no recycle bin) |
find / -name "*.conf" | Searches for files by name |
grep -r "error" /var/log | Searches text inside files |
File permissions
Every file has permissions for three classes: the owner (u), the group (g) and others (o). Each class can have read (r = 4), write (w = 2) and execute (x = 1).
For example, chmod 750 script.sh gives the owner full access (7), the group read and execute (5) and others nothing (0). Similarly, chown alice:devs report.txt changes the owner and group. Read more in our guide to Linux file and directory permissions, and for SUID, SGID and the sticky bit see advanced permissions.
Revision notes: users and groups
Key files
| File | What it stores |
|---|---|
/etc/passwd | User accounts: name, UID, GID, home directory and shell |
/etc/shadow | Hashed passwords and password ageing (root-only) |
/etc/group | Groups and their members |
/etc/gshadow | Group passwords and administrators |
Key commands
| Command | What it does |
|---|---|
useradd -m -s /bin/bash alice | Creates a user with a home directory and Bash shell |
passwd alice | Sets or changes a password |
usermod -aG sudo alice | Adds a user to a group without removing others |
userdel -r alice | Deletes a user and their home directory |
groupadd devs | Creates a group |
id alice | Shows UID, GID and group memberships |
chage -l alice | Shows password expiry settings |
A common trap is usermod -G without -a. It replaces all of the user’s supplementary groups instead of adding one. Also note that the root user always has UID 0. On most modern distributions, regular users start at UID 1000.
For the full walkthrough, read Linux user and group management.
Ready for more?
Once you pass both quizzes, move on to real server skills. For example, practise creating swap and LVM partitions in a virtual machine. Then prepare with our Linux interview questions.
Sources
Running Linux servers in production? Our Linux server hardening & security audit checks configuration, patching, SSH and logging. You can also use our free Linux server hardening checklist, or contact us.
