Wednesday, August 4, 2010

Unix Questions - Set 1-2

Question1

To get the PID of last background process

  1. echo $#
  2. echo $!
  3. echo $0
  4. echo $$

Question 2

The -v option of sh causes the shell to

  1. Debugs if shell script has any error
  2. Does nothing
  3. Echo each command before it is executed
  4. Gives verbal output

Question 3

The option to o test for zero length string is

  1. -s
  2. -z
  3. -a
  4. -d

Question 4

A file is identified by _____ associated with it

  1. Inode number
  2. Process-id number
  3. Group-id number
  4. User-id number

Question 5

The default value of umask is

  1. 777
  2. 644
  3. 022
  4. 422

Question 6

Which of the following command is used to find the largest capacity of a file (maximum bytes a file can hold)

  1. Umask
  2. Ulimit
  3. FLargeLimit
  4. None of the above

Question 7

Using ___ you can accept input from the standard input, process it and send the output to the standard output

  1. Filters
  2. Pipe
  3. Both A and B
  4. None of the above

Question 8

What is the internal value associated with the standard error device?

  1. 0
  2. 1
  3. 2
  4. None of the above

Question 9

Block commands work

  1. On group of lines
  2. On single line
  3. On a single file
  4. None of the above

Question 10

In which of the following modes vi (editor) works

  1. Command mode
  2. Insert mode
  3. Ex command mode
  4. All of the above

Question 11

Which commands help in viewing lines at the beginning or at the end of the file?

  1. Touch and cat
  2. Head and tail
  3. Touch and head
  4. Cat and tail

Question 12

Which of the following commands are used to save disk space?

  1. Ulimit
  2. Compress
  3. Pack
  4. Both B and C

Question 13

What is the command for viewing a compressed file?

  1. cat
  2. touch
  3. zcat
  4. acat

Question 14

Password created for a user is stored in a file

  1. /dev/passwd
  2. /usr/passwd
  3. /etc/passwd
  4. /bin/passwd

Question 15

Which of the following is true?

  1. A DOS formatted floppy can be used in Unix and a Unix formatted floppy can be used in DOS
  2. A DOS formatted floppy can be used in Unix but a Unix formatted floppy cannot be used in DOS
  3. A Unix formatted floppy can be used in DOS but a DOS formatted floppy cannot be used in Unix
  4. None of the above

Question 16

Which of the following is a metacharacter?

  1. m>
  2. &&
  3. $1..$9
  4. All of the above

Question 17

Block command works in

  1. Command mode
  2. Insert mode
  3. Ex command mode
  4. All of the above

Question 18

How can you create hidden files in Unix

  1. *filename
  2. .filename
  3. $filename
  4. #filename

Question 19

What happens when the following command is executed?

(date; banner welcome; ls)> one 2>two

  1. date along with the banner and list of all the files is written into files one and two
  2. date along with the banner and list of all the files is written only into file two
  3. date along with the banner and list of all the files is written only into file one
  4. syntax error

Question 20

Which of the following command is used to execute commands at specified date and time?

  1. nohup
  2. cron
  3. fgrep
  4. None of the above

 

Answers

Answer 1 - B

Answer 2 - C

Answer 3 - B

Answer 4 - A

Answer 5 - C

Answer 6 - B

Answer 7 - A

Answer 8 - C

Answer 9 - A

Answer 10 - D

Answer 11 - B

Answer 12 - D

Answer 13 - C

Answer 14 - C

Answer 15 - B

Answer 16 - D

Answer 17 - C

Answer 18 - B

Answer 19 - C

Answer 20 - B

No comments:

Post a Comment