wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QUIZ 4

Total questions: 25

Worksheet time: 17mins

Name
Class
Date
1.

Which file contains the list of user accounts on a Linux system?

a)

/etc/users

b)

/etc/passwd

c)

/etc/groups

d)

/etc/accounts

2.

To make a script executable in Linux, which command would you use?

a)

exec

b)

chmod

c)

execute

d)

run

3.

Which command is used to display the disk usage of files and directories in Linux?

a)

du

b)

df

c)

diskutil

d)

diskfree

4.

Which file contains the hostname of the system in Red Hat Enterprise Linux?

a)

/etc/hostname

b)

/etc/sysconfig/hostname

c)

/etc/host

d)

/etc/hosts

5.

What is the purpose of the grep command in Linux?

a)

To display the calendar

b)

To search for patterns in files

c)

To compress files

d)

To display disk usage

Answer

6.

What is the purpose of the tar command in Linux?

a)

To compress files

b)

To copy files

c)

To manipulate tape archives

d)

To manage tasks

Answer

7.

What is the purpose of the systemctl command in Red Hat Enterprise Linux?

a)

To schedule tasks

b)

To display system information

c)

To configure network settings

d)

To manage services

8.

Out of the six fields of crontab what field number 3 signifies?

a)

  Hour of day

b)

Day of week

c)

Month of year

d)

Day of month

9.

The cron daemon will run the script ‘/home/user1/script1.sh every tenth minute past the hour on the 2nd, 3rd, 4th, 5th, and 6th day of every 6th month.

(a)  

10.

Schedule one job with at command that will run it at 1am on December 12, 2024.

(a)  

11.

What does -c operation do in grep command?

a)

Matches either upper or lowercase

b)

Prints only the count of matching lines.

c)

Prints the matched line and its line number.

d)

Prints all lines that do not match pattern.

12.

Which command is used (most appropriate) to copy all files having the string ramp and any two characters after that to the progs directory?

a)

cp ramp?? progs

b)

cp ramp* progs

c)

cp ramp[12] /progs/*.*

d)

cp ramp?? /progs/*

13.

What does the following command do?

$ echo *

a)

error

b)

undefined behavior

c)

displays “*”

d)

lists all filenames in the current directory

14.

How will you list only the empty lines in a file name.txt (using grep)?

a)

grep “$^” name.txt

b)

grep “$” name.txt

c)

grep “^$” name.txt

d)

grep $^ name.txt

15.

Given the script echo.sh containing

 

echo "$4", "$3", "$2", "$1"

What is the output of

$ ./echo.sh a b "c d"

a)

a, b, c, d

b)

d, c, b, a

c)

c d, b, a

d)

c d, b, a

16.

User named "Ram" is member of groups linux and shell. Which of the following command will append group LPU to him?

a)

usermod -a -G LPU Ram

b)

useradd -aG LPU Ram

c)

usermod -g LPU Ram

d)

usermod -gG LPU Ram

17.

Which of the following will accuratly search all files with name "passwd" in /etc directory and copy it to directory named "New"?

a)

find /etc -name passwd -exec cp {} NEW \;

b)

find /etc -name passwd

c)

find /etc passwd -exc -name cp {} NEW \;

d)

find / -name passwd -exec cp {} NEW \;

18.

                       SELinux labels have several contexts:

Follow the below syntax and tell what third field represents:

unconfined_u: object_r: httpd_sys_content_t: s0 /var/www/html/file2

a)

User

b)

Role

c)

Type

d)

Sensitivity

19.



(a)  

20.

You work as a system admin for NYK.ltd. you want to add swap space of 512MB to /dev/sda1 hard drive of your system to run the applications. Which of the following correct order of the commands should you run to accomplish this task. select the correct answer.

I. mkswap /dev/sda1

II swapon /dev/sda1

III. swap /dev/sda1

a)

Only I

b)

Only II and III

c)

Only I and II

d)

Only I, II, III

21.

Set permissions on the /home/operators directory so it is set GID, the owner and group have full read/write/execute permissions, and other users have no permissions on the directory.

(a)  

22.

Write the syntax to change the default user shell to the KornShell for user bsmith.

(a)  

23.

To create a tarball called /tmp/files.tar containing multiple files(/etc/host.conf /etc/shadow /etc/passwd /etc/yum.conf) from the /etc directory:

(a)  

24.

Change both ownership and group membership to user200 recursively on dir10.

(a)  

25.

Write the complete command to send the public key of the SSH key pair to student1 on serverb.

(a)