Vous êtes sur la page 1sur 8

The permission bits of a file noname. can be set to _rws_ _x_ _x by the comma nd. A. B. C. D.

chmod 711 noname chmod go -rw noname chmod 2711 noname None of the above

Explanation : We can use the command chmod 711 noname, followed by chmod u+s noname (use ls -1 noname and check). Else use the single command chmod 4711 noname. What is this "s" anyway? Only the super user has the permission to change /etc/ passwd f ile. But any user can update it through the passwd (bin/passwd) command. If you type ls-l /bin/passwd you can see the user execution bit set to s instead of x). It is because of this "s". a user can access /etc/passwd through the passwd com mand, for which he is not otherwise entitled to /bin/passwd has the user execution permission set to 's' because A. This facility assigns to the user, permissions of the program owner. tem porarily B. It should allow users who don't have write permission to /etc/passwd to write to it C. D. /etc/passwd is write protected All of these

If one doesn't want anyone else to read or write to a file named datfile, except through a program in a file filex , then he may use A. B. C. ANS D Shell script is preferable to other forms of programming because it A. B. C. D. Makes programming task easier Enhances portability Occupies less space All of these chmod u+s filex ; chmod go_rw datfile chmod 4711 filex ; chmod go_rw datfile chmod 4711 datfile ; chmod go_rw filex

Files that store data in the same format as used in program are called

A. B. C. D.

binary files Source file Text file Core

To allow only one user to work with a particular file at a particular time, one has to use A. B. C. D. Semaphore Critical region Locking Dedicated mode

The differences between malloc( ) and calloc() are: A. Malloc is used for dynamic allocation of memory, while cal:1?c can't be used for that purpose B. C. Malloc needs only one argument. while cal loc needs two.

unlike malloc, calloc allocates memory and initializes it to 0. D. Both (b) and (c)

The main reasons for the success of pipes are A. B. C. D. The availability of many filter programs UNIX treats devices as files It provides a 2-way communication channel Both (a) and (b)

Which of the following are not filter programs? A. B. C. D. A. date sort cat grep

Redirection in pipes can be achieved by using

A. B. C. D. C

> >> tee lpr

Which of the following information is not present in an i-node A. B. C. D. Contents of the the Name of the file Size of the file Both (a) and (b)

The system identifies a file by its A. B. C. D. D The system identifies the end of a file by the A. B. C. D. B Which of the following metacharacters will be recognized by the shell. even if i t comes within double quotes? A. B. C. D. $ * ? None of the above EOF character file size i-node number Both (a) and (b) name absolute path Both (a) and (b) Mode number

lint should be used A. before compilation

B. C. D.

to analyze a C code after compilation Both (a) and (b)

Answer: Option D Explanation : lint can throw light on many things, which the compiler generally overlooks. So. potential errors can be spotted and the program is debugged, even before compil ation. Hence the answer is (d)

Environment variables can be accessed by A. B. C. D. system programs C programs shell scripts All of these

The .(dot) shell command A. B. C. D. Can take command line argument Will fork a child shell to execute the named shell script Can be used to change the environment of the current shell All of the above

Answer: Option C Explanation : Any shell script will not be executed hy the current shell. The current shell fo rks a new shell that executes the named shell script and terminates after it. So , any variable exported in the shell script will not be recognized by the parent shell. The (dot) command makes the named shell script to be executed by the cur rent shell. On the negative side . (dot) commands like( profile) don't accept co mmand line arguments. The shell command : A. B. C. D. Does nothing Can be used to cause infinite looping Can take arguments but it cannot act on them All of these

The first thing that is searched when a command references a file is it A. B. C. D. i-node i-node number permission setting none of the above

Suppose you enter a command like cp x y. Unlike the user, who uses the name to i dentify and differentiate files, the system uses i-node number to uniquely ident ify a file. Any file name has an associated i-node number. In UNIX. different fi les can have the same name. But the associated i-nodc number will be different. The filename---i-node correspondence can be found in the directory which has to be the first one that is to be searched, as nothing can be done to a file withou t knowing its i-node number. cc command sequentially invokes A. B. C. D. C preprocessor. compiler and link editor compiler and link editor preprocessor, compiler. assembler and link editor compiler, assembler and link editor

Among the directory entries, i-node and the file contents. which will be changed when a file is updated? A. B. C. D. Only directory entry and tile contents Only i-node and file contents All the three None

The mv command changes A. B. C. D. A Only the directory entry Only the directory entry and i-node Only the i-node number None of the above

Choose the correct answers if the command ls -l /dev/mt0 display's brw_rw_ _ _ _ 1 root 3, 0 Apr18 1:05 mt0 A. B. C. D. The 'b' indicates that it is a special file mt0 indicates that it is a tape drive The ' b' indicates that data transfer is done in blocks All of these

For regular (ordinary) files the first character (i.e. b here), will be just a u nderscore. For directories d. for character special files ' ' and ' b' for a blo ck read special file. The last column will have lp for line printer. hp for disk drives. tty for terminals etc. The 3 in 3 , denotes the major device number and - minor device number. That is. this system denotes tape drives by 3 and 0 to s ingle out a particular tape drive from the many tape drives, the system may have .

cat/dev/tty A. B. C. D. Throws garbage onto the terminal 1. Just echoes what you type. line by line Terminates if one types control at the beginning of a line Both (b) & (c)

Answer: Option D Explanation : First, the i-node number corresponding to idevi tty (i.e. the terminal currently used) is procured. Then the i-node is accessed. From it, the system understands , it is a character special file. So, whatever you type, if followed by ' n ' wi ll he echoed in the terminal. Typing control d, also lushes the buffer contents to t ty. But unlike 'control d is not transmitted. So. if you type ab ( Ad) cd ( Ad) first ab will be immediately transmitted, then cd will be transmitted. When ever you press control d. then what you have typed between the previous control d (or from the start of the current line) to the current control d will be trans mitted. So. if you type two control d consecutively or a single control d. at th e beginning of a line then you are telling it to transmit. but nothing is there to be transmitted. So. the command gets terminated. The header files used in C programs arc usually found in A. B. /bin/include usr/bin/include

C. D. A

/dev/ include iusr/include

Context switch changes the process mode from A. B. C. D. user to kernel mode kernel to user mode kernel mode to the kernel process Both (a) and (b)

The difference between a pipe and a regular file is that A. B. C. D. Unlike a regular file, pipe is not a file. The data in a pipe is transient. unlike the contents of a regular file Pipes forbid random accessing. while regular files do allow this Both (b) and (c)

Which of the following comments about the signals system call are true? A. B. C. D. It takes up two arguments The first argument is an integer The second argument is a pointer to a function All of the above

lex can be used for A. B. C. D. Text processing Code enciphering Compiler construction All of these

Which of the following displays the exit status of the last executed command? A. B. C. D. C echo $4 echo $$ echo $? echo $!

Vous aimerez peut-être aussi