TechBeamersTechBeamers
  • Viral Tips 🔥
  • Free CoursesTOP
  • TutorialsNEW
    • Python Tutorial
    • Python Examples
    • C Programming
    • Java Programming
    • MySQL Tutorial
    • Selenium Tutorial
    • Selenium Python
    • Playwright Python
    • Software Testing Tutorial
    • Agile Concepts
    • Linux Concepts
    • HowTo Guides
    • Android Topics
    • AngularJS Guides
    • Learn Automation
    • Technology Guides
  • Top Interviews & Quizzes
    • SQL Interview Questions
    • Testing Interview Questions
    • Python Interview Questions
    • Selenium Interview Questions
    • C Sharp Interview Questions
    • Java Interview Questions
    • Web Development Questions
    • PHP Interview Questions
    • Python Quizzes
    • Java Quizzes
    • Selenium Quizzes
    • Testing Quizzes
    • HTML CSS Quiz
    • Shell Script Quizzes
  • ToolsHOT
    • Python Online Compiler
    • Python Code Checker
    • C Online Compiler
    • Review Best IDEs
    • Random Letter Gen
    • Random Num Gen
TechBeamersTechBeamers
Search
  • Viral Tips 🔥
  • Free CoursesTOP
  • TutorialsNEW
    • Python Tutorial
    • Python Examples
    • C Programming
    • Java Programming
    • MySQL Tutorial
    • Selenium Tutorial
    • Selenium Python
    • Playwright Python
    • Software Testing Tutorial
    • Agile Concepts
    • Linux Concepts
    • HowTo Guides
    • Android Topics
    • AngularJS Guides
    • Learn Automation
    • Technology Guides
  • Top Interviews & Quizzes
    • SQL Interview Questions
    • Testing Interview Questions
    • Python Interview Questions
    • Selenium Interview Questions
    • C Sharp Interview Questions
    • Java Interview Questions
    • Web Development Questions
    • PHP Interview Questions
    • Python Quizzes
    • Java Quizzes
    • Selenium Quizzes
    • Testing Quizzes
    • HTML CSS Quiz
    • Shell Script Quizzes
  • ToolsHOT
    • Python Online Compiler
    • Python Code Checker
    • C Online Compiler
    • Review Best IDEs
    • Random Letter Gen
    • Random Num Gen
Follow US
© TechBeamers. All Rights Reserved.
Linux TutorialsShell Script Quiz

30 Linux Questions – Online Test

Last updated: Mar 06, 2025 11:05 am
Meenakshi Agarwal
By
Meenakshi Agarwal
Meenakshi Agarwal Avatar
ByMeenakshi Agarwal
Hi, I'm Meenakshi Agarwal. I have a Bachelor's degree in Computer Science and a Master's degree in Computer Applications. After spending over a decade in large...
Follow:
No Comments
1 month ago
Share
11 Min Read
SHARE

Every Linux OS has four primary components: Kernel, Shells, System Utils, and Application Programs. However, mostly we use to interact with the Shells and Linux commands to get on to the tasks. Hence, we bring you 30 Linux questions on essential OS concepts and frequently used commands.

Especially in this quiz, we’ve assembled thirty situation-based questions on Linux commands. In each question, you’ll be asked to select a command that can fit in the given scenario.

For example, you might run into a case where you’ll have to leave but run a program in the background. Alternatively, the program has to throw all errors and output to a single file. In some other scenarios, you may have to copy the final logs to a remote machine after finishing a task.

These types of Linux questions are useful in the sense that they’ll make you think about the real-time usage of the OS commands.

By the way, if you are one of a shell scripting freak, then do attempt this Unix Shell scripting quiz.

Learning all Linux commands isn’t as easy as remembering the alphabet. One can only keep them memorized by mapping them to a palpable situation. Hence, we wrote a dedicated post covering essential Linux commands which you can use as a quick reference.

30 Linux Questions With Answers – Online Test

Answer Key with Reasoning

Here’s a concise reasoning table explaining the correct answers for all 30 Linux-related questions.

Q#Correct AnswerReasoning
1uname -runame -r prints the kernel version, while other commands are incorrect.
2ls -Zls -Z lists files along with their security context (SELinux labels).
3shutdown -h now, poweroffBoth commands immediately shut down the system. shutdown -h now is more commonly used.
4gpasswd -rgpasswd -r removes a group’s password, unlike passwd commands, which are for user passwords.
5tar tvf file.tartar tvf lists the contents of a tar file without extracting it.
6shadow/etc/shadow stores encrypted passwords, providing extra security.
7ls -rtls -rt sorts files by modification time, oldest first.
8Create home directoryuseradd does not create a home directory unless -m is specified.
9Password field blankIn /etc/passwd, an empty password field means authentication uses shadow passwords.
10Username, UID, GID, shell/etc/passwd contains username, UID, GID, home directory, shell, and comments.
11ps -ef --forestps -ef --forest displays processes in a tree format.
12fc 10fc 10 opens the 10th command in an editor for modification and execution.
13chmod o+t /tmpThe o+t flag sets the sticky bit, preventing users from deleting others’ files in /tmp.
14/dev/stdincat - reads input from stdin (/dev/stdin).
15.bashrc.bashrc executes when a new terminal session starts, setting up the environment.
16Ctrl+DCtrl+D sends an EOF signal, closing the terminal session.
17/etc/passwd/etc/passwd lists all system users along with their details.
18command > file 2>&1This redirects both stdout and stderr to the same file.
19rm -rfrm -rf forcefully deletes non-empty directories, unlike rmdir, which only removes empty ones.
20Discard stderr2> /dev/null discards error messages by redirecting stderr to /dev/null.
21echo $SHELLecho $SHELL prints the default shell for the user.
22Ctrl+Alt+F1Ctrl+Alt+F1 switches to virtual terminal 1 in a Linux GUI system.
23ps -C httpdps -C httpd lists all running httpd (Apache) processes.
24!!!! repeats the last executed command.
25idid displays the current user’s UID and GID.
26usermod -L localusrusermod -L locks a user account by disabling its password.
27/etc/inittab/etc/inittab defines system runlevels in older Linux distributions (SysV init).
28rw-r--r--644 means read-write for the owner and read-only for others.
29chmod 544 file544 sets r-xr--r--, allowing only the owner to execute.
30ls -als -a lists all files, including hidden ones (files starting with .).

Key Takeaways from the Linux Quiz

We hope that you would have enjoyed solving each and every question of this online Linux quiz. The knowledge that you would gain from here is not only relevant in the interviews, but you can also use it in handling real-time tasks. Those who have recently started playing with Linux can go through the below post and learn even more.

Also Read: Linux Interview Questions and Answers

Before we conclude for the day, let’s listen to an interesting quote about Linux. It highlights why it’s counted as the best Server operating system.

It’s a bird. It’s a plane. No, it’s Kernel Man, faster than a speeding bullet, to your rescue.

It was none other than the Linus Torvalds who said this in his speech while announcing a new Kernel release.

Keep Learning,
TechBeamers

Related

TAGGED:Linux OS Questions
Share This Article
Flipboard Copy Link
Subscribe
Notify of
guest

guest

0 Comments
Newest
Oldest
Inline Feedbacks
View all comments

List of Topics

Stay Connected

FacebookLike
XFollow
YoutubeSubscribe
LinkedInFollow

Subscribe to Blog via Email

Enter your email address to subscribe to latest knowledge sharing updates.

Join 1,009 other subscribers

Continue Reading

  • Makefile Tutorial to Create Client-Server ProgramSep 6
  • Essential Linux Questions for Better ResultsSep 7
  • 30 Linux Basic Questions And AnswersSep 7
  • 50+ Linux/macOS Terminal CommandsSep 9
  • Basic Linux Questions and AnswersSep 10
  • Set Static IP on Windows, Ubuntu & OS XJun 16
  • Simple Steps to Create a Service in LinuxJul 10
  • Learn to Implement C++ Class in C ProgrammingJul 21
  • How to Use GDB with Six Debugging TipsAug 3
  • Ant Script to Change System Date-TimeAug 5
View all →

RELATED TUTORIALS

Linux Commands Cheat Sheet for Daily Reference

Easy to Recall Linux Commands Cheat Sheet

By Harsh S.
10 months ago
What is the Difference Between Git Repository and Directory

Difference Between Git Repo and Directory

By Harsh S.
2 days ago
How to Use GDB to Debug a C Program

How to Use GDB with Six Debugging Tips

By Harsh S.
2 months ago
Bash script code challenges

20 Bash Script Code Challenges for Beginners with Their Solutions

By Meenakshi Agarwal
1 year ago
© TechBeamers. All Rights Reserved.
  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms of Use
wpDiscuz