Sie sind auf Seite 1von 5

Sample Paper-1

1)Which of the following is true?


a)Shell is a process and runs like any user process
b)Shell is a built-in Kernel functionality
c)Shell is a wrapper for all the commands and utilities
d)None of the above

Answer : A.

2)Which is true with regards to the shell prompt


a)It can be accidentally erased with backspace
b)The prompt cannot be modified
c)The prompt can be customized (modified)
d)None of the above

Answer : C.

3)The /etc/passwd file contains


a)User account info
b)User id and password in encrypted form
c)Just the password of the user in encrypted form
d)None of the above

Answer : A.

4)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 above

Answer : B.

5)If a file is removed in Unix using 'rm' then


a)The file can be recovered by a normal user
b)The file cannot be recovered by a user
c)The file can be fully recovered provided the sytem is not rebooted
d)The file will be moved to /lost+found directory and can be recovered only by
administrator's intervention

Answer :B.

6)Executing the 'cd ..' command when at the root level causes
a)Error message indicating the user can't access beyond the root level
b)Behavior is unix-flavor dependent
c)Results in changing to the 'home' directory
d)Nothing happens

Answer : D.

7)The login shell is


a)The shell program that runs when the user logs in
b)The shell program that authenticates the user while logging in
c)Common shell for all the users that belong to the same group
d)All of the above

Answer : A.

8)System calls are


a)The interface to the Kernel
b)Like any function call, implemented as part of the shell
c)Privileged calls that only superuser can make use of
d)None of the above

Answer :A.

9)Hidden files are


a)Those whose 'read' bit is set to 'h'
b)Permitted for (can be accessed) only superusers
c)Files that begin with a '.'
d)a & c

Answer : C.

10)Which of the following is true?


a)There is one superblock per system
b)There is one superblock per filesystem
c)There may be more than one superblock per filesystem ( non-redundant )
d)None of the above

Answer : B.
Description: In a typical unix file system, every filesystem has one superblock only.
There may be a redundant superblock to protect against failures

11)A filename is modified using the command “mv filea fileb”, where fileb already
exists. In this scenario, which of the following is true?
a)fileb’s inode number is changed to filea’s inode number
b)fileb’s inode number does not change, remains the same the old fileb
c)The inode entry for fileb is not affected by this command
d)None of the above
Answer :A.
Description: fileb has the inode number that filea had earlier and the inode entry of fileb
is released to the kernel.

12)Which of the following is true regarding inode number ?


a)Two files in a system may have the same inode number
b)Two files( non-linked) in a filesystem may have the same inode number
c)When a file is deleted, the inode is also deleted, the same inode number is not reused
d)None of the above

Answer :A.
Description: Inodes are unique within a filesystem, the kernel maintains the free inodes
list and reallocates them when needed

13)A user creates a large data file ( ~ 1 MB size). Which of the following is true
regarding the storage of this file on disk?
a)The file is stored in contiguous data disk blocks
b)The file is stored in disk blocks that are not contiguous, the disk blocks maintain the
pointer to the next storage block
c)The inode information alone is not sufficient to identify all the disk blocks
d)The file is stored in disk blocks that may not be contiguous, the inode keeps track of
where the data blocks are

Answer:D.
Description: The file is stored in disk data blocks that may not be contiguous, the details
of these are stored in the inode addressing information

14)The ls –l output for /etc/passwd and /usr/bin/passwd is as follows:


-rw-rw-r-- 1 root root 2807 Apr 26 13:50 /etc/passwd
-r-s—x—x 1 root root 17008 May 25 02:30 /usr/bin/passwd
If a user, not belonging to the group ‘root’, runs the passwd executable in an attempt to
modify his password, then which of the following is true?
a)The passwd change fails since the user does not have permission to update the
/etc/passwd file
b)The passwd change is successful because the program runs as root
c)The passwd change program runs in kernel mode where write access to the /etc/passwd
file is possible
d)/etc/passwd is a special file and the system by default allows all users to update it

Answer:B.
Description: Since the setuid bit is set for /usr/bin/passwd, the program runs as root. Root
has access to update the /etc/passwd file.

15)A user executes the following command successfully:


$ chmod +x file1.txt
Which of the following is true of the output of this command?
a)The command results in adding execute permission to the user who ran this command
b)The command results in adding execute permission for the owner of the file
c)The command results in an error since the file is not an executable file
d)The command results in adding execute permission for all users

Answer:D.
Description:This command can be run only by the owner of the file( or root), and it adds
execute permission for all

16)The ls –al output on directory /home/user1/temp looks as follows:


$ cd /home/user1/temp
$ ls -al
-rw-rw-r-- 1 user1 usrgrp 17008 May 25 02:30 .
-rw-rw-r-- 1 user1 usrgrp 17008 May 25 02:30 ..
-r—r—r-- 1 user1 usrgrp 17008 May 25 02:30 file1
$
If user1 executes the command “rm file1”, then which of the following is true?
a)The file is removed successfully ( and silently )
b)The rm command prompts for a confirmation, the command is successful upon
confirmation
c)The rm command prompts for a confirmation, however the operation fails because of
insufficient permissions
d)The rm command fails because of insufficient permissions

Answer:B.
Description: For deleting a file, directory write permission is sufficient, irrespective of
file write permissions. The system prompts for user confirmation if there is no file write
permission

17)A user creates a link to a file file1 using the following command “ln file1
file2”.Which of the following is true of a ls –ali output on this directory? The directory
does not contain any other files or directories.
a)file1 and file2 have the same inode numbers
b)The number of links for file1 is displayed as 1
c)The number of links for the directory (.) is displayed as 3
d)a & c

Answer:A. Files that are hard—linked have the same inode number.The number of links
field is 2 for both file1 and file2.The number of links displayed for the directory is not
incremented because of the links created in files in the directory.

18)A user does a chmod operation on a file. Which of the following is true?
a)The last accessed time of file is updated
b)The last written time of file is updated
c)The inode access time of file is updated
d)a & c
Answer:C.
Description: The file contents are not accessed or updated, hence file access/write times
are not updated. The permissions info is stored in the inode, hence the inode time is
updated.

19)Look at the following code segment.


#include <stdio.h>
int numEntr = 5;
char c;
main()
{
int i = 0;
char *data;
i = GetEntr();
data = malloc ( sizeof(char) * i ));
….
….
}
int GetEntr ()
{
…………….
………..
}
Which of the following is true?
a)Variable numEntr is stored in the heap segment
b)Variable c, being uninitialized, is part of bss segment
c)Variable i is initialized and hence part of data segment
d)a & b

Answer:B.
Description: Initialized global data is stored as part of data segment;Local variables are
stored on stack

20)The signal sent to a process when the Ctrl-C key is pressed is


a)KILL
b)TSTP
c)TERM
d)INT

Answer:D.

Das könnte Ihnen auch gefallen