wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

shell programing

Total questions: 49

Worksheet time: 25mins

Name
Class
Date
1.

Which Unix command is used for changing the current directory?

a)

pwd

b)

rm

c)

cd

d)

cp

2.

Which command is used for displaying the contents of a file in Unix?

a)

mkdir

b)

cat

c)

rm

d)

cp

3.

Which of the following commands is known as stream editor?

a)

grep

b)

tr

c)

sed

d)

td

4.

Which of the following is not a type of shell?

a)

The C Shell

b)

The Korn Shell

c)

The Bourne Shell

d)

The Perl Shell

5.

What is the default symbol for command prompt in Bourne shell?

a)

!

b)

#

c)

$

d)

@

6.

Which of the following is not a feature of Unix?

a)

A) multiuser

b)

B) easy to use

c)

C) multitasking

d)

D) portability

7.

Which part of the Unix operating system interacts with the hardware?

a)

A) Application program

b)

B) Vi editor

c)

C) Kernel

d)

D) Shell

8.

Which command is used to compress files?

a)

A) Zip

b)

B) Zipc

c)

C) gunzip

d)

D) gzip

9.

echo command is used for _________

a)

A) displaying operating system details

b)

B) displaying errors

c)

C) displaying date and time

d)

D) displaying diagnostic messages

10.

Which of the following commands is used to list contents of directories?

a)

A.lp

c)

C.dir

d)

D.tar

11.

Which command is used to remove a file?

a)

A.del

c)

C.rm

d)

B.remove

12.

The cat command is used to

a)

(A) Capture a file

b)

(B) Display a file

c)

(C) Print a file

d)

(D) Copy a file

13.

Which of the following commands is used to assign executable permission to the owner of the file named "note"?

a)

(A) chmod g+x note

b)

(B) chmod u+w note

c)

(C) chmod u+x note

d)

(D) chmod ugo+x note

14.

Which command will be used with vi editor to append text at end of line?

a)

(A) A

b)

(B) a

c)

(C) i

d)

(D) l

15.

Which command is used to list all the files with extension .lst?

a)

(A) ls -l *.lst

b)

(B) ls lst*

c)

(C) ls .

d)

(D) ls *[lst]

16.

Which shell programming construct would be best for writing a menu driven shell script?

a)

case

b)

if

c)

test

d)

for

17.

UNIX Shell is designed for the:

a)

Developer

b)

Programmer

c)

End user

d)

None of the above

18.

What is the core of a Linux Operating System?

a)

Kernel

b)

Shell

c)

Command

d)

GUI

19.

The following command can list out all the current active logins.

a)

A - whoami

b)

B - who am i

c)

C - who

d)

D - None of the above.

20.

Unix is a

a)

Single User, Single tasking OS

b)

Single User, Multi-tasking OS

c)

Multi-User, Multi- tasking OS

d)

None

21.

To Display line of text/string that are passed as an argument with a command

a)

cat

b)

echo

c)

ls

d)

none of the above

22.

Which command in UNIX is used to change the user account passwords.

a)

pwd

b)

password

c)

passwd

d)

none of the above

23.

which command is used to see the calendar of any specific month or a complete year

a)

calendar

b)

cal

c)

none of the above

24.

Shell scripts are executed in a separate child shell process.

a)

a) True

b)

b) False

25.
Shell Program is stored in a file called
a)
Unix
b)
Sh
c)
Dd
d)
Cc
26.

What is a shell script?

a)

group of commands

b)

a file containing special symbols

c)

a file containing a series of commands

d)

group of functions

27.

Which command is used for making the scripts interactive?

a)

a) ip

b)

b) input

c)

c) read

d)

d) write

28.

The first argument is read by the shell into the parameter ___

a)

a) 1$

b)

b) $3

c)

c) $$

d)

d) $1

29.

The complete set of positional parameters is stored in ______ as a single string.

a)

a) $n

b)

b) $#

c)

c) $*

d)

d) $$

30.

Which command is used to display the top of the file?

a)

A cat

b)

B.head

c)

C.more

d)

D.grep

e)

E.None of the above

31.

What command was NOT discussed?

a)

AWK

b)

SED

c)

DD

d)

GREP

32.

Unix shell command that lists directory contents of files and directories with hidden files.

a)

ls -d

b)

ls -F

c)

ls -a

d)

ls -l

33.

Which command is used to display the top of the file?

a)

A cat

b)

B.head

c)

C.more

d)

D.grep

e)

E.None of the above

34.

which commands gives the no of recently logged in users?

a)

who

b)

who | wc -w

c)

whoami | wc -l

d)

who | wc -l

35.

delete all file starting with d and ending with t?

a)

rm dt*

b)

rm d*t

c)

rm td*

d)

rm t*

36.

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

37.

Which command is used for printing the current working directory?

a)

HOME

b)

cd

c)

pwd

d)

dir

38.

cd command cannot be used without any argument.

a)

True

b)

False

39.

Which command is used for creating directories?

a)

rmdir

b)

mkdir

c)

cd

d)

cp

40.

We can create multiple directories by single invocation of mkdir command.

a)

True

b)

False

41.

Which command is used for removing an empty directory?

a)

mkdir

b)

rmdir

c)

del

d)

remove

42.

Which of the following is true about the date command?

a)

Without arguments it displays the current date only

b)

Without arguments it displays both current date and time

43.

The standard tree structure starts at which directory?

a)

home

b)

user

c)

root

d)

bin

44.

The --------------------- is responsible for the management of processes.

a)

Shell

b)

User

c)

Kernel

d)

Administrator

45.

On a Unix system, the ______________ refers to a privileged account with unrestricted access to all files and commands

a)

root user

b)

home user

c)

unknown user

d)

super user

46.

What term is used to describe a running program on Linux?

a)

Application

b)

Process

c)

Runtime

d)

Project

47.

An Operating System is an interface between

a)

user and software

b)

user and hardware

c)

user, software and hardware

d)

None of the above

48.

Unix operating system is written in

a)

Ada Language

b)

Perl Language

c)

C Language

d)

Pascal Language

49.

ksh means

a)

Korn Shell

b)

Kornn Shell

c)

Shell

d)

C shell