Linux Administration Basics Questions with Answers

25 practice questions on Linux Administration Basics (DevOps & Kubernetes) with answers and step-by-step solutions. Try 10 samples below, then practise all 25 free in the AptiNest app.

Sample questions

Question 1Easy

Which command shows the full path of the directory you are currently in?

  1. cd
  2. ls
  3. pwd
  4. whoami

Answer: C. pwd

Explanation

pwd stands for print working directory.

Step-by-step solution

  1. pwd stands for print working directory.
  2. So the answer is: pwd.

Why the other options are wrong

  • A. cd changes directory.
  • B. ls lists files.
  • D. whoami prints the user name.

Question 2Easy

The user ID of root is

  1. 1
  2. 0
  3. 100
  4. 1000

Answer: B. 0

Explanation

UID 0 gives full privileges.

Step-by-step solution

  1. UID 0 gives full privileges.
  2. So the answer is: 0.

Why the other options are wrong

  • A. 1 is a system user.
  • C. 100 is not root.
  • D. 1000 is usually the first normal user.

Question 3Easy

Which command lists files in a directory with details?

  1. dir -x
  2. list -a
  3. show -l
  4. ls -l

Answer: D. ls -l

Explanation

ls -l shows permissions, owner, size and modification time.

Step-by-step solution

  1. ls -l shows permissions, owner, size and modification time.
  2. So the answer is: ls -l.

Why the other options are wrong

  • A. dir -x is not the Linux way.
  • B. list is not a command.
  • C. show is not a command.

Question 4Medium

Which command forcibly terminates a process with PID 1234?

  1. stop 1234
  2. kill -9 1234
  3. end 1234
  4. halt -1234

Answer: B. kill -9 1234

Explanation

kill -9 sends SIGKILL, which cannot be ignored.

Step-by-step solution

  1. kill -9 sends SIGKILL, which cannot be ignored.
  2. So the answer is: kill -9 1234.

Why the other options are wrong

  • A. stop is not a command.
  • C. end is not a command.
  • D. halt shuts the system down.

Question 5Medium

Which command shows disk space usage in human-readable form for file systems?

  1. du -h only
  2. free -h
  3. df -h
  4. ls -h

Answer: C. df -h

Explanation

df -h shows free and used space per mounted file system.

Step-by-step solution

  1. df -h shows free and used space per mounted file system.
  2. So the answer is: df -h.

Why the other options are wrong

  • A. du reports usage of directories.
  • B. free shows memory.
  • D. ls -h formats file sizes.

Question 6Medium

Which command changes the owner of a file?

  1. chown
  2. chmod
  3. chgrp
  4. passwd

Answer: A. chown

Explanation

chown user:group file sets ownership.

Step-by-step solution

  1. chown user:group file sets ownership.
  2. So the answer is: chown.

Why the other options are wrong

  • B. chmod changes permissions.
  • C. chgrp changes the group.
  • D. passwd changes passwords.

Question 7Medium

Which command displays the manual page of a command?

  1. man
  2. help -m
  3. doc
  4. info -x

Answer: A. man

Explanation

man ls opens the manual for ls.

Step-by-step solution

  1. man ls opens the manual for ls.
  2. So the answer is: man.

Why the other options are wrong

  • B. help is a shell builtin help.
  • C. doc is not standard.
  • D. info -x is not the manual command.

Question 8Medium

Which command manages services on systems using systemd?

  1. serviced
  2. systemctl
  3. initctl only
  4. svc

Answer: B. systemctl

Explanation

systemctl start|stop|status nginx controls services.

Step-by-step solution

  1. systemctl start|stop|status nginx controls services.
  2. So the answer is: systemctl.

Why the other options are wrong

  • A. Not the systemd tool.
  • C. initctl is for Upstart.
  • D. Not standard.

Question 9Hard

What does the cron expression "*/5 * * * *" mean?

  1. Run every 5 minutes
  2. Run at 5 am daily
  3. Run every 5 hours
  4. Run on the 5th of each month

Answer: A. Run every 5 minutes

Explanation

The first field is minutes and */5 means every 5 minutes.

Step-by-step solution

  1. The first field is minutes and */5 means every 5 minutes.
  2. So the answer is: Run every 5 minutes.

Why the other options are wrong

  • B. 5 am would be 0 5 * * *.
  • C. Hours would be 0 */5 * * *.
  • D. The fifth would be 0 0 5 * *.

Question 10Hard

With umask 022, a newly created regular file gets the default mode

  1. 666
  2. 755
  3. 644
  4. 600

Answer: C. 644

Explanation

Files start at 666 and the umask removes 022, giving 644. Directories start at 777 and get 755.

Step-by-step solution

  1. Files start at 666 and the umask removes 022, giving 644.
  2. Directories start at 777 and get 755.
  3. So the answer is: 644.

Why the other options are wrong

  • A. 666 is before the umask.
  • B. 755 is for directories.
  • D. 600 would need umask 077.

Practise all 25 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all DevOps & Kubernetes topics · All topics