Professional Documents
Culture Documents
Unix Module 3 MCQ
Unix Module 3 MCQ
Unix Module 3 MCQ
MCQ’S
Answers
1. Answer: a
Explanation: An attribute defines the property of an object. In UNIX, every file has a set
of attributes which defines the specification of the file.
2. Answer: c
Explanation: ls command is used for listing the attributes of a file or directory. ls
command when used with -l displays all the seven attributes of a file.
3. Answer: d
Explanation: When -l option is used with ls command it simply displays seven attributes
of a file which are file type and permissions, links, ownership, group ownership, file size,
last modification time, filename.
4. Answer: a
Explanation: Links are defined as the number of filenames of a single file that are
maintained by the system. This file can be accessed through as many filenames as there is
a number of links to that file.
5. Answer: b
Explanation: There are basically two types of links; hard link and soft links.
6. Answer: d
Explanation: ls command when combined with -d option displays the attributes of a
directory rather than its contents.
7. Answer: b
Explanation: Directory attributes are of major concern as compared to file attributes when
performing any operation on file system because files are a part of directory or we can
say that files are stored under the directory in the directory tree. So if directory attributes
does not allow us to perform a particular operation on the directory than that operation
can never be performed on the file which is stored inside that directory.
8. Answer: c
Explanation: Sine files are written to the disk in terms of block size, the size consumed
by the file vary from the original size of the file. Suppose, if a file size is 800 bytes but
the block size on the system is 1024 bytes, then that file will consume 1024 bytes on
diskspace i.e. 1 block.
9. Answer: b
Explanation: When ls command is used with -l option its displays attributes of a file in
the multi-columnar form. The first column defines the file types and permissions
associated with a file. If the permissions are preceded by a (-), then it is an ordinary file
otherwise it is a directory.
10. Answer: c
Explanation: In UNIX system, a file can have three types of permissions -read, write and
execute. Read permission means that the file is readable. Write permission means that the
file can be edited while executing permission (for a directory) means that we can “pass
through” the directory file for searching subdirectories.
11. Answer: a
Explanation: A file can have three types of permissions; read, write and execute which is
represented by characters r, w and x respectively.
12. Answer: a
Explanation: UNIX provides a three tired file protection system that determines the file
access rights i.e. the permissions are dived into three groups as
13. Answer: d
Explanation: ( – ) is used to indicate the absence of a single or set of permissions of a file.
For example, if a file has all the three permissions for owner but is only readable by
group members and others, then the set of permissions would be,
rwx r-- r--
14. Answer: a
Explanation: In most cases, the user which creates the file is regarded as owner of the
file. The owner of the file can create, delete or edit the file or he can change the
permissions associated with it.
15. Answer: a
Explanation: When the system administrator creates a user account, he assigns the user
two parameters; UID (user ID) and GID (group ID). Group id denotes the group to which
the user belongs.
In simple words, group ownership defines the group to which the file is accessible.
16. Answer: a
Explanation: Since the second and third group of permissions of a file are r– and —
respectively. So the file is only readable and that too, only by the members of the group
to which the file belongs.
17. Answer: b
Explanation: If a file is not readable then it is obvious that we cannot write anything to
the file. To write anything to a file it should be readable first. But if a file is writable then
we can read the file easily but the reverse is not true.
18. Answer: d
Explanation: The write permission of a directory does not imply that we can write to the
directory. Only kernel is allowed to do that. It simply means that we can create or remove
files from the directory.
19. Answer: b
Explanation: The term ‘write-protected’ has a limited meaning in the UNIX file system.
A file which is write protected cannot be written, but it can be removed if the directory
has to write permission.
20. Answer: d
Explanation: Executing a directory does not make any sense, execute permission simply
means that a user can “pass through” the directory while searching for subdirectories.
When we use pathname with any command we should have execute permission for each
of the directories involved in the complete pathname. For example,
cd users/users06/abd/dir01/file01.txt // all directories should have execute permission.
21. Answer: a
Explanation: The default permission set for an ordinary file is rw-rw-rw i.e. it is readable
and writable by owner, group member and others.
22. Answer: b
Explanation: The default permission set for an ordinary file is rwxrwxrwx i.e. it is
readable, writable, executable by owner, group members and others.
23. Answer: b
Explanation: The file owner cannot edit the file because the owner’s permission overrides
the group’s permission. In other words, the priority of owner’s permission is greater than
group’s permission.
24. Answer: a
Explanation: The expression used by chmod in an absolute manner is a string of three
octal numbers (base 8). A set of 3 bits represent a single octal digit.
-> Read permission –4 (100 in octal)
-> Write permission –2(010 in octal)
-> Execute permission –1(001 in octal)
For each category, we add up these numbers. For example, if we have to set read and
write permission then an octal number will be 110 (4+2).
25. Answer: d
Explanation: For changing the file ownership, we use the chown command. chown
transfer the ownership of a file to another user. The command requires the user-ID (UID)
of the recipient. To change the ownership of a file from user01 to user02, use the
following commands:
26. Answer: c
Explanation: A user can change the group owner of a file but only to that group to which
he belongs. A user can belong to more than one group and the one shown in /etc/psswd is
the user’s main group.
27. Answer: b
Explanation: Group ownership can be changed only to that group to which the user also
belongs otherwise a user cannot change the group ownership of a file to another group to
which he does not belong.