Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz #1

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Where is account of user in Linux?

a)

/etc/passwd

b)

/etc/users

c)

/etc/group

d)

/etc/user

2.

How many users in linux system?

a)

2

b)

3

c)

4

d)

5

3.

How many permission in linux?

a)

2

b)

3

c)

4

d)

5

4.

How many column of users account?

a)

4

b)

5

c)

6

d)

7

5.

What is command to change day after password change?

a)

usermod -e "2026-01-15" user1

b)

usermod -m 10 user1

c)

chage -e "2026-01-15" user1

d)

chage -m 10 user1

6.

which command to display user status?

a)

chage -S user1

b)

chage -L user1

c)

passwd -S user1

d)

passwd -s user1

7.

which command for lock account?

a)

usermod -L user1

b)

usermod -l user1

c)

passwd -l user1

d)

passwd -L user1

8.

what is comamnd to lock password of user1?

a)

usermod -L user1

b)

usermod -l user1

c)

passwd -l user1

d)

passwd -L user1

9.

What is command to limited password changed after expired?

a)

chage -m 10 user1

b)

chage -M 10 user1

c)

chage -I 10 user1

d)

chage -W user1

10.

Where is location of file for group?

a)

/etc/group

b)

/etc/groups

c)

/var/group

d)

/var/groups

11.

which command for rename file or directory?

a)

cp

b)

mv

c)

cd

d)

rm

12.

what is command for copy directory?

a)

cp

b)

mv

c)

rm

d)

mkdir

13.

Change permission of User to read and write of file1.txt without octal.

a)

chmod 600 file1.txt

b)

chmod u+rw file1.txt

c)

chmod 777 file1.txt

d)

chmod u+r file1.txt

14.

echo "$#" what is result of this command?

a)

File Name

b)

Paramter Name

c)

Number of Parameter

d)

Number of File

15.

Result of command echo "#HOME"

a)

Home Directory

b)

User Directory

c)

Current Working Directory

d)

Directory of User

16.

What is the command to view the current user's home directory?

a)

cd ~

b)

ls ~

c)

echo $HOME

d)

pwd

17.

Which command is used to change the ownership of a file?

a)

chown

b)

mv

c)

chmod

d)

chgrp

18.

What is the command to display the last 10 lines of a file?

a)

tail -n 10 file.txt

b)

head -n 10 file.txt

c)

less file.txt

d)

cat file.txt

19.

What command is used to display the current working directory?

a)

cd

b)

pwd

c)

ls

d)

echo

20.

Which command is used to remove a directory?

a)

rm -r

b)

mv

c)

rmdir

d)

del

21.

What is the command to list all files, including hidden ones?

a)

ls -l

b)

ls -R

c)

ls -a

d)

ls -h

22.

How do you display the contents of a file one page at a time?

a)

cat file.txt

b)

more file.txt

c)

head file.txt

d)

tail file.txt

23.

What is the command to find the location of a command?

a)

whereis

b)

locate

c)

which

d)

find

24.

What is the purpose of the shebang (#!) at the beginning of a shell script?

a)

To comment out the first line

b)

To indicate the script's file type

c)

To specify the interpreter for the script

d)

To define the script's execution permissions

25.

How can you pass arguments to a shell script?

a)

Through standard input

b)

By using the 'set' command

c)

By specifying them after the script name

d)

Using environment variables

26.

Which command is used to set an environment variable in a shell script?

a)

env VAR=value

b)

set VAR=value

c)

define VAR=value

d)

export VAR=value

27.

What operator is used for numeric comparison to check if two numbers are equal in a shell script?

a)

==

b)

=

c)

eq

d)

===

28.

Which command is used to compare two numbers and return true if the first is greater than the second?

a)

if [ $a -gt $b ]

b)

if [ $a > $b ]

c)

if [ $a < $b ]

d)

if [ $a -ge $b ]

29.

What is the correct syntax to check if a number is less than or equal to another number in a shell script?

a)

if [ $a -le $b ]

b)

if [ $a <= $b ]

c)

if [ $a -lt $b ]

d)

if [ $a < $b ]

30.

What command clears the contents of your terminal display?

a)

clear

b)

cache

c)

delete

d)

remove

31.

Which of the Linux command-line commands listed below is used for directory traversal/navigation?

a)

change

b)

cd

c)

cdc

d)

ps

32.

What command creates an empty directory?

a)

Ipp

b)

Cd chown

c)

mkdir

d)

None of these

33.

What command to check/see current working directory?

a)

who

b)

pwd

c)

where

d)

catch

34.

Which of the following commands in Linux is used to display information about files and directories contained within the current working directory?

a)

ls

b)

sl

c)

show

d)

None of these

35.

What is the command to list hidden files & directory?

a)

ls -l

b)

ls -a

c)

ls

d)

None of these

36.

show information about the current logged in user

a)

id

b)

ids

c)

id user

d)

id username

37.

show information about a user

a)

id username

b)

ids username

c)

info username

d)

info user

38.
While managing user accounts, you accidentally mistype the username during account creation. How can you fix this username error?
a)
Edit the /etc/ passwd file manually.
b)
There's no way to fix the username after creation. You'll need to delete and recreate the account.
c)
Use the usermod command to modify the username.
d)
Use the passwd command to reset the password.
39.

file for checking if user was created

a)

/etc/passwd

b)

/etc/password

c)

/etc/user

d)

/etc/group

40.

Which command changes deepak’s home directory from its default location to /usr/local directory? (select 1)

a)

usermod -d /usr/local deepak

b)

usermod -g /usr/local deepak

c)

usermod -l /usr/local deepak

d)

usermod -a /usr/local deepak

41.

What is the command to delete the home directory of user along with the user?

a)

# userdel <username>

b)

# userdel -l <username>

c)

# userdel -r <username>

d)

# userdel -d <username>

42.

User id 0 is

a)

An innvalid user id

b)

The id of the root user

c)

The id of a user when the user’s account is deleted

d)

None of the mentioned

43.

Which one is command in shell script?

a)

//

b)

/* */

c)

#

d)

!#

44.

What is a shell script?

a)

group of commands

b)

a file containing a series of commands

c)

group of functions

d)

a file containing special symbols

45.
You've written a script that needs to prompt the user for a filename. How can you achieve this within the script?
a)
print "Enter filename:"
b)
echo "Enter filename:"
c)
read filename
d)
ask filename
46.
Your script needs to check if a specific file exists before proceeding. Which command can help determine this?
a)
show file
b)
find file
c)
test -f file
d)
check file
47.
You want your script to display a custom message after completing its tasks. How can you output text to the console within the script?
a)
print message
b)
echo message
c)
write message
d)
display message
48.
You want to make your script executable so you can run it from the command line. What command should you use?
a)
chmod +x script.sh
b)
run script.sh
c)
source script.sh
d)
execute script.sh
49.

To find out what your path is, at the Unix shell prompt________

a)

$echo PATH

b)

$echo $path

c)

$echo $PATH

d)

none of the above

50.

change permission of a file to rw-r--r-x?

a)

chmod 546 file

b)

chmod 642 file

c)

chmod 645 file

d)

chmod 655 file