Check out 30 Linux questions on essential OS concepts and frequently used commands.

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.

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 scenario, you may have to copy final logs to a remote machine after finishing a task.

These types of Linux questions are useful in the sense as they’ll make you think 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 like remembering the alphabet. One can only keep them memorized by mapping 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

Time limit: 0 Quiz-summary 0 of 30 questions completed Questions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Information For your information, please note that this Linux test has both single and multiple choice questions. So, we suggest you please carefully attempt all the questions. Press the below Start quiz button to go ahead.

Please continue. You have already completed the quiz before. Hence you can not start it again. Quiz is loading... You must sign in or sign up to start the quiz. You have to finish following quiz, to start this quiz: Results 0 of 30 questions answered correctly Your time: Time has elapsed You have reached 0 of 0 points, (0) Categories Linux 0% Hopefully, you would have enjoyed this Linux test. Please do share this post on facebook, twitter and other social media platforms of your choice.

If you want to view the correct answers for this quiz, then please press the View questions button shown below.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Answered Review Question 1 of 30 1 . Question 10 points Select the command to display the kernel release? kernel -r

uname -r

cat /proc/etc/kernel/release

cat /etc/config/kernel/release

None Correct

Incorrect

Question 2 of 30 2 . Question 10 points Select the command to list older files first and newer ones last? ls /o-d

ls -od

ls -rt

ls -dt Correct

Incorrect

Question 3 of 30 3 . Question 10 points Select the command to show process hierarchy in forest format? ps -ef -tree

ps -ef --f

ps -ef -t

ps -ef --forest Correct

Incorrect

Question 4 of 30 4 . Question 10 points Select the command to edit and run any command using its index from the history? For example – Edit and run the 10th command. fc 10

hs 10

rc 10

er 10 Correct

Incorrect

Question 5 of 30 5 . Question 10 points Which of the following commands would you use to enable the sticky bit on the “/tmp” folder? chmod u+s /tmp

chmod o+t /tmp

chmod a+s /tmp

chmod +st /tmp Correct

Incorrect

Question 6 of 30 6 . Question 10 points Some commands (including cat) interpret a minus sign (-) as a shortcut for which of the following? /dev/stdin

/dev/stdout

/dev/stderr

/dev/hdal

None Correct

Incorrect

Question 7 of 30 7 . Question 10 points If you want to display a message on opening a new terminal window, which file is to be modified? .bashtr

.linux_term

.term_win

.bashrc Correct

Incorrect

Question 8 of 30 8 . Question 10 points What keyboard combination can be used to exit the shell? Ctrl+E

Ctrl+C

Ctrl+Z

Ctrl+D Correct

Incorrect

Question 9 of 30 9 . Question 10 points Which of the following command would redirect the stdout and stderr to a single file? dir > file.txt 2>&1

dir > file.txt

dir > file.txt 2>1

dir > file.txt 2&1 Correct

Incorrect

Question 10 of 30 10 . Question 10 points How would you remove a directory that is not empty? rm -f

rm -rf

rmdir -rf

rmdir -all Correct

Incorrect

Question 11 of 30 11 . Question 10 points Select the correct meaning of the following command? command 2> /dev/null Send the output of command to a file called /dev/null.

Discard standard error entirely.

Append the output of command to a file called /dev/null.

Send error messages from command to a file called /dev/null. Correct

Incorrect

Question 12 of 30 12 . Question 10 points Select the command to determine the current login shell? echo $SHELL

echo $$SHELL

cat /etc/current/shell

cat /etc/shell

ps | grep sshd

None Correct

Incorrect

Question 13 of 30 13 . Question 10 points Select the correct command to switch to virtual terminal 1. Ctrl+Alt+F1

Alt+F1

Ctrl+F1

Shift+Ctrl+F1 Correct

Incorrect

Question 14 of 30 14 . Question 10 points Select the command to display the running httpd processes. ps -d httpd

ps -C httpd

ps -r httpd

ps -D httpd Correct

Incorrect

Question 15 of 30 15 . Question 10 points Which of the following runs the last command you entered? ~!

..

!~

!!

None Correct

Incorrect

Question 16 of 30 16 . Question 10 points Select the command to provide the information about the identity, including the names of the group we belong? echo $UID

id

cat /etc/passwd

cat /etc/groups Correct

Incorrect

Question 17 of 30 17 . Question 10 points Select the command to lock the user account named localusr. usermod -l localusr

usermod -L localusr

usermod --l localusr

usermod -lock localusr

None Correct

Incorrect

Question 18 of 30 18 . Question 10 points Which file determines the run at each runlevel? /etc/init/runlevels

/etc/levels/fstab

/etc/fstab

/etc/inittab Correct

Incorrect

Question 19 of 30 19 . Question 10 points What is the symbolic representation of this numeric permission: 644? rwxr-xr-x

rw-r--r--

rw-------

r--rw-rw- Correct

Incorrect

Question 20 of 30 20 . Question 10 points Given a file with permission 755, which of the following commands would change file permission to r-xr–r–? chgrp 544 filename

chmod u+w,go+x filename

chmod u-rx,go-r filename

chmod 544 filename Correct

Incorrect

Question 21 of 30 21 . Question 10 points Select the command to show all the hidden directory contents. ls -i

ls /a

ls -s

ls -a Correct

Incorrect

Question 22 of 30 22 . Question 10 points To list the directory contents with permissions the command is? ls -z

ls -Z

ls -/z

ls -/Z Correct

Incorrect

Question 23 of 30 23 . Question 10 points Select the commands to shut down the machine. shut down

shutdown -h now

poweroff

power off

None Correct

Incorrect

Question 24 of 30 24 . Question 10 points Choose the command used to remove the password assigned to a group. passwd -rm

passwd -r group

gpasswd -r

grouppasswd -rm

None Correct

Incorrect

Question 25 of 30 25 . Question 10 points Suppose while working for another system administrator and one of the users asks you to restore a file for him. You locate the correct tar file by checking the backup log but do not know about the directory structure. Select the command to determine this? tar fx tarfile dirname

tar ctf tarfile

tar tvf tarfile filename

tar tvf tarfile Correct

Incorrect

Question 26 of 30 26 . Question 10 points Which password package secures the central password file from getting stolen? pam

tcp_wrappers

securepass

ssh

shadow

None Correct

Incorrect

Question 27 of 30 27 . Question 10 points Which of the following tasks is not done automatically for a user account created using useradd command? Assign a UID.

Assign a default shell.

Create the user's home directory.

Define the user's home directory. Correct

Incorrect

Question 28 of 30 28 . Question 10 points What characteristic of the </etc/passwd> file does not allow to use the shadow passwords? The login command is missing.

The username is too long.

An asterisk prefaces the password field.

The password field is blank. Correct

Incorrect

Question 29 of 30 29 . Question 10 points Which of the following options lists all the seven fields of the </etc/passwd> file in the correct order? Username, UID, GID, home directory, command, comment.

Username, UID, group name, GID, home directory, comment.

UID, username, GID, home directory, comment, command.

Username, UID, GID, comment, home directory, command. Correct

Incorrect

Question 30 of 30 30 . Question 10 points Which of the following files defines all users on a Linux system? /etc/passwd

/etc/users

/etc/password

/etc/user.conf Correct

Incorrect



We hope that you would have enjoyed solving each and every question of this online Linux quiz. The knowledge which 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.

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 great Linus Torvald who said this in his speech while announcing a new Kernel release.

Keep Learning,

TechBeamers