wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

UNIX and Shell Programming: Module 3 – File Attributes (MCQs)

Total questions: 42

Worksheet time: 21mins

Name
Class
Date
1.

Which command is used to list the attributes of a file?

a)

cp

b)

list

c)

ls

d)

attr

2.

Which one of the following is not an attribute displayed by ls command?

a)

file permissions

b)

file ownership

c)

links

d)

word count of file

3.

Hard linked files are provided with the same inode number as the original one.

a)

True

b)

False

4.

Soft linked files are provided with different inode number as the original one.

a)

True

b)

False

5.

Which option is used with ls command to list the directory attributes rather than its contents?

a)

-b

b)

-a

c)

-l

d)

-d

6.

A file can be recognized as an ordinary file or directory by ____ symbol.

a)

$

b)

-

c)

*

d)

/

7.

How many types of permissions a file has in UNIX?

a)

1

b)

2

c)

3

d)

4

8.

Permissions of a file are represented by which of the following characters?

a)

r, w, x

b)

e, w, x

c)

x, w, e

d)

e, x, w

9.

A file named abd.txt has the following set of permissions -rwxrwxrwx All the three operations i.e read, write and execute can be performed on the file by file owner, group owner and others.

a)

True

b)

False

10.

Which of the following symbol is used to indicate the absence of a permission of a file?

a)

$

b)

&

c)

+

d)

-

11.

What is group ownership?

a)

group of users who can access the file

b)

group of users who can create the file

c)

group of users who can edit the file

d)

group of users who can delete the file

12.

A file has permissions as rwx r– –. A user other than the owner cannot edit the file.

a)

True

b)

False

13.

If a file is read protected, we can write to the file.

a)

True

b)

False

14.

The write permission for a directory determines that ____________

a)

we can write to a directory file

b)

we can read the directory file

c)

we can execute the directory file

d)

we can add or remove files to it

15.

Which of the following is default permission set for ordinary files?

a)

rw-rw-rw-

b)

rwxrwxrwx

c)

r–r–r–

d)

rw-rw-rwx

16.

Which of the following is default permission set for directories?

a)

rw-rw-rw-

b)

rwxrwxrwx

c)

r–r–r–

d)

rw-rw-rwx

17.

A file owner does not have a permission to edit the file but the group to which the file owner belong do have the permission to edit it. Can owner edit the file?

a)

Yes

b)

No

c)

Cannot be defined

d)

Error will be encountered

18.

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

a)

chmod

b)

ch

c)

chown

d)

chgrp

19.

chmod command can be used in ____ ways.

a)

3

b)

2

c)

5

d)

0

20.

The expression used with chmod command to change permissions in a relative manner contains ____ components.

a)

5

b)

2

c)

4

d)

3

21.

Which of the following characters specify the user and group category?

a)

'u' and 'g'

b)

'g' and 'o'

c)

'us' and 'gr'

d)

'u' and 'o'

22.

Which of the following symbol is used with chmod to assign permission to a file?

a)

-

b)

/

c)

+

d)

*

23.

To assign execute permission to the user (owner) for a file named file01.txt, which of the following command will be used?

a)

chmod u+r file01.txt

b)

chmod u+w file01.txt

c)

chmod u-x file01.txt

d)

chmod u+x file01.txt

24.

A file named file01 should be readable, writable and executable only by the user(owner). Which one of the following set of command will be used?

a)

chmod 700 file01

b)

chmod 000 file01

c)

chmod 477 file01

d)

chmod 777 file01

25.

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

a)

chmod

b)

change

c)

ch

d)

chown

26.

Which option is used for the recursive functioning of chmod command?

a)

-R

b)

-r

c)

-l

d)

-i

27.

Which command is used to change the group owner of the file?

a)

chown

b)

ch

c)

chgrp

d)

chmod

28.

Like chmod, chown and chgrp can also use ___ option.

a)

-R

b)

-r

c)

-x

d)

-i

29.

Which editor is used by the UNIX system to edit files?

a)

vi

b)

notepad

c)

word

d)

notepad++

30.

What does the following command do? $ vi file001

a)

open file named file001

b)

edit file named file001

c)

delete a file named file001

d)

open file if it exists else creates a new file

31.

How many types of modes are used by vi editor?

a)

2

b)

4

c)

3

d)

1

32.

What is the default mode of vi editor?

a)

Command mode

b)

Input mode

c)

Ex mode

d)

Insert mode

33.

To insert text into a file, _____ mode is used.

a)

Command mode

b)

Input mode

c)

Ex mode

d)

def mode

34.

ex mode is used for what purpose?

a)

file handling

b)

substitution

c)

file handling and substitution

d)

Inputting text in files

35.

Which one of the following key is used to switch from command mode to input mode?

a)

i

b)

:

c)

esc

d)

;

36.

________ key is used for switching to command mode from input mode.

a)

i

b)

A

c)

:

d)

esc

37.

Which of the following key is used to enter in ex-mode?

a)

ESC

b)

i

c)

:

d)

;

38.

To clear the screen in vi editor, _____ is used.

a)

ctrl-h

b)

ctrl-l

c)

ctrl-p

d)

ctrl-v

39.

To quit vi editor without saving the buffer we can use

a)

:q

b)

:c

c)

:w

d)

:q!

40.

One of the most important features of vi editor is _______

a)

available mostly across all UNIX platforms

b)

easy to learn

c)

latest editor

d)

powerful than other editors

41.

Commands inputted in command mode don’t appear on the terminal.

a)

True

b)

False

42.

While entering text in input mode the data is saved in _____

a)

buffer

b)

disk

c)

RAM

d)

cache