Linux Server Quiz

The following Quiz comprises multiple choice questions which tests the knowledge of a user in various areas of Linux system administration.

Linux Quiz


Ready for the Quiz? Click Play button below to get started.

Linux Quiz

Question 1 of 30.

Which of the following command lists the last 10 lines of a file?

1. grep
2. tail
3. cat
4. head

tail command is used to display last 10 lines of a file. You could use -n parameter with tail command and specify how many lines you want to display (10 lines are default).

Example:

tail -n 20 /var/log/messages

The above command will display last 20 lines of /var/log/messages file.

Question 2 of 30.

Which program is used to schedule jobs on a Linux system?

1. Scheduler
2. cron
3. Task Scheduler
4. cups

Cron is the right answer.

Question 3 of 30.

RPM:

1. is used to install, uninstall, and manage packages
2. is used to keep track of the users
3. stands for Red Hat Package Manager
4. assigns a dynamic IP address

RPM stands for Red Hat Package Manager

Question 4 of 30.

What command is used to assign executable permission to everyone on the file named "work"?

1. chmod ugo+x work
2. chmod u+x work
3. chmod ugo+rw work
4. chmod ugo+r work

The chmod ugo+x work command will grant execute permission to everyone on file named work

Question 5 of 30.

What is the location of some system configuration and system administrator executable files?

1. /home
2. /var
3. /proc
4. /sbin

/sbin is the right answer

Question 6 of 30.

What command is used to count the number of files in the current directory by using pipes?

1. ls | ws -c
2. ls | wc -w
3. ls | wc -l
4. ls | wc

ls | wc -l is the right answer.

Question 7 of 30.

What file contains the list of port numbers & associated names monitored by inetd?

1. /etc/nsorder
2. /etc/services
3. /etc/nsswitch.conf/
4. /etc/hosts

/etc/services is the right answer

Question 8 of 30.

Which tool is used to automate the install of Red Hat Linux on identical hardware?

1. kickstart
2. ghost
3. bzimage.img
4. None of above

kickstart is used to automate the installation of Red Hat Linux on identical hardware. The configuration file is saved as /root/anaconda-ks.cfg

Question 9 of 30.

What command is used to halt a Linux system?

1. shutdown -t
2. init 0
3. Ctrl+Alt+Del
4. None of above

init 0 command halts the Linux system while init 6 causes it to reboot.

Question 10 of 30.

What is the result of following command:

find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn

1. Displays the number of files in current working directory
2. Displays the inode count of all the sub-directories in current working directory
3. Displays the number of directories in current working directory
4. None of above

This command displays the inode count of all the sub-directories in current working directory.

The Web Hosting providers generally advertise themselves as offering unlimited disk space on their Shared hosting. But they offer the users with a limited inode count. If you want to display the count of inodes in each directory, this command is for you.

Question 11 of 30.

Which command changes a file’s group owner

1. chgrp
2. cgrp
3. change
4. group

chgrp command changes the file’s group owner

Question 12 of 30.

Which command is used to display disk consumption of a specific directory?

1. dd
2. ds
3. du
4. None of above

du command displays the disk consumption of a specific directory

Question 13 of 30.

LILO

1. stands for Linux loader
2. is the Linux boot loader
3. is a tool used to boot the Kernel on x86 hardware
4. All of the above

LILO is the abbreviation for LInux LOader. It is a legacy boot loader for Linux used to boot the Kernel on x86 hardware

Question 14 of 30.

You added a new user named bob to a linux system. Which group is bob added to by default?

1. root
2. nobody
3. bob
4. admins

The user bob will be member of bob group.

When a user is created in Linux, a group with same name is already created and the user is added as a member of this group. In a nutshell, when a user is created, the user belong to same group as that of his username.

Question 15 of 30.

What will be the result of following command:

find / -name ‘*’

1. List all files and directories in / directory
2. List all files in / directory
3. List a file named * in /
4. List all files and directories recursively starting from /

This command lists all files and directories recursively starting from /

Question 16 of 30.

Which of the following command is equivalent to:

chmod 761 letter

1. chmod u=rwx, g=rw, o=x letter
2. chmod 4=7, g=6, o=4 letter
3. chmod a+761 letter
4. chmod 167 letter

chmod u = rwx, g = rw, o = x letter is the right answer

Question 17 of 30.

Which command is used to extract intermediate result in a pipeline?

1. exec
2. extract
3. tee
4. tail

tee command is used to extract intermediate result in a pipeline.

Question 18 of 30.

Where does Ret Hat Linux stores the system and mail logs?

1. /var/log
2. /mail
3. /etc/log
4. /proc

By default, system and mail logs are written to /var/log directory.

Question 19 of 30.

How can you rebuild the RPM file to include the new patches?

1. --generate
2. --recompile
3. --rebuild
4. --execute

rpmbuild --rebuild command is used to rebuild the RPM file to include the new patches

Question 20 of 30.

Which option of ls command is used to view file inode number?

1. -l
2. -i
3. -I
4. -a

ls -i command is used to display index number (inode) of file(s)

Question 21 of 30.

What command is used to query for a specific package with RPM?

1. rpm -a
2. rpm -q
3. rpm -d
4. rpm -l

rpm -q command is used to query a specific package.

Question 22 of 30.

What is the result of following command:

zip -r backup.zip techtutsonline.com/*

1. Adds all the files (including hidden) in techtutsonline.com to backup.zip archive
2. Adds all the files (excluding hidden) in techtutsonline.com to backup.zip archive
3. Adds techtutsonline.com directory recursively (including hidden files) to backup.zip archive
4. Adds techtutsonline.com directory recursively (excluding hidden files) to backup.zip archive

This command will add the techtutsonline.com directory recursively (excluding hidden files) to backup.zip archive

Question 23 of 30.

Which of the following tool is used to check and repair Linux file systems?

1. chkdsk
2. mkfs
3. scandisk
4. fsck

fsck is used to check the Linux file system.

This is similar to chkdsk in Windows systems. 🙂

Question 24 of 30.

Which Linux command shows which user I am currently logged on with?

1. pwd
2. whoami
3. which
4. None of the above

whoami commands displays the currently logged on user name.

Question 25 of 30.

Which of the following is the main configuration file of Apache server?

1. apache.conf
2. httpd.conf
3. web.conf
4. config

httpd.conf is Apache server's main configuration file.

Question 26 of 30.

Who founded the Linux Kernel?

1. Ben Thomas
2. Richard Stallman
3. Linus Torvalds
4. None of the above

Linus Torvalds is known as founder of Linux kernel.

Question 27 of 30.

Which command is used to display the operating system name?

1. kernel
2. uname
3. version
4. ver

uname command displays the operating system name. It is commonly used with other options to generate desired output. uname -a command displays the complete name of operating system including hostname, kernel, and OS architecture.

Question 28 of 30.

In what file can you specify which users are not allowed to access a system via FTP?

1. /etc/ftpusers
2. /etc/hosts.deny
3. /etc/ftpaccess
4. None of the above
Question 29 of 30.

What would be the Partition ID of swap partition created using fdisk?

1. 85
2. 84
3. 83
4. 82

Swap partition ID is 82 whereas regular Linux partition ID is 83.

Question 30 of 30.

What command is used to display your current working directory?

1. dir
2. path
3. prompt pwd
4. pwd

pwd command (abbreviation for print working directory) is used to display current working directory

Next question 1 of 30

All 30 questions completed!


Share results:

Linux Quiz

Want more stuff like this?

Get the best viral stories straight into your inbox!
Don`t worry, we don`t spam