Unix Operating System

Description: Unix commands , operating system
Number of Questions: 25
Created by:
Tags: Unix Linux Shell scripts commands Operating System
Attempted 0/25 Correct 0 Score 0

What are the three types of files of the Unix System?

  1. Regular file, directories, device file

  2. Regular disk file, special file, device file

  3. Tape file, directories, special file

  4. All of the above


Correct Option: A
Explanation:

Regular file, Directory file and Device files are three types of files of Unix. The regular file is also called as ordinary file. Directory file is used for directories files and diectory. The device file is used for peripheral devices and other devices operations.

Which meta character is used to match zero or more occurences of the character immediately preceeding it?

  1. ?

  2. ^

  3. +

  4. *


Correct Option: D
Explanation:
  • is a wild card character. It matches 0 or more occurrences of the preceding regular expression.

Which special shell variable provides the number of arguments supplied to a script?

  1. $#

  2. $0

  3. $!

  4. $@


Correct Option: A
Explanation:

The $# command(shell variable) provides the number of arguments supplied to a script .

How can you replace a single character in vi input mode?

  1. cc

  2. cw

  3. s

  4. r


Correct Option: D
Explanation:

If one can replace any single character by using this command.

Which of the following commands is used to give complete online access to the Unix Manuals?

  1. Top

  2. Sort

  3. Man

  4. Grep


Correct Option: C
Explanation:

Man is a powerful tool that gives one complete online access to the UNIX manuals.

Which of the following is the awk built in functions?

  1. int() function

  2. log(n) function

  3. sqrt(n) function

  4. all of the above


Correct Option: D
Explanation:

 sin(n) , log(n) , int() all these are awk built in functions just like in c language.

By pressing which keys, we will generate a shell signal?

  1. Shift + ctrl + a

  2. Ctrl + Z

  3. Ctrl + c

  4. Zero


Correct Option: A
Explanation:

Shift + ctrl + a will generate a shell signal.

How can we invoke new process execution by which unix command?

  1. nohup

  2. execute()

  3. exec()

  4. kill


Correct Option: C
Explanation:

The exec() is used to execute new process in Unix.

Which of the following processes of state represents changes from run to ready?

  1. Waiting for user response

  2. Waiting for disk read occurs

  3. Time slices expires

  4. all of the above


Correct Option: D
Explanation:

All of the above are state of processes from run to ready like waiting for user response, waiting for disk read occurs and time slices occurs. RUNNING, READ, WAITING OR BLOCKED are states.

Which command is used to assign an inode number to file?

  1. Chgrp

  2. Chmod

  3. Mv

  4. Cp


Correct Option: D
Explanation:

Cp is used to copy files and it copies the inode number to other files also.

Let us have a syntax grep ^saurabh myfile, what it displays or gives as output?

  1. It shows those lines that end with saurabh.

  2. Shows those lines that contains more than a single instance of saurabh.

  3. Shows those line that begin with saurabh.

  4. Shows those lines which do not contain saurabh.


Correct Option: C
Explanation:

 ^saurabh is used to search line beginning with saurabh, ^ is a wild character used for searching one instance of the string or line.

Which is not a part of the inode for a file?

  1. File modification time

  2. File size

  3. Directory name to which file belongs

  4. File permissions


Correct Option: C
Explanation:

 We cannot find the file or directory name from inode. We can see the file type not file or directory name in inode attributes, so it is not a part of inode.

Which of the following is a multipurpose tool?

  1. grep

  2. sed

  3. editor

  4. awk


Correct Option: D
Explanation:

The awk is a multipurpose tool which has pattern scanning and processing language. It is an editor having multipurpose functionalities.

By which command one specifies receipt of a signal?

  1. Trap

  2. Ping

  3. Finger

  4. All of the above


Correct Option: A
Explanation:

Trap is used. Trapping signals is quite easy, and the trap command has the following syntax -$ trap commands signals.

Which of the following init runlevels is used for system HALT?

  1. 6

  2. 1

  3. 3

  4. 0


Correct Option: D
Explanation:

Run level 0 is used to HALT the system or system shutdown.

Which of the following statements is false with respect to tar command?

  1. It is used to create tape archives.

  2. It is used to add files.

  3. All users are permitted to use tar.

  4. It is used to extract files.


Correct Option: C
Explanation:

All users are not authorized to access tar, only admin or authorized personnel have rights to use tar command.

Let us have a code - x = 5, y = 5, what is a current syntax for the product of x and y (means x * y)?

  1. expr $x * $y

  2. expr $x * $y

  3. echo $x *$y

  4. echo $x * $y


Correct Option: B
Explanation:

 The expr is to convert value in integer because unix takes by default all values in string or character , and * a strike is a wild card which has two meanings in following arithmetic formula(aritmetic formula is for product is x * y ), so back slash is used to terminate the meaning of * as wild card, because we want multiply the x and y. Therefore, the above code is correct.

Which command is used for file compression in unix?

  1. gzip

  2. gunzip

  3. zcat

  4. all of the above


Correct Option: D
Explanation:

The gzip, gunzip and zcat are used for compressing and expanding the files in unix. For example: gzip myflie. compress is used to compress the files in unix.

Which command determines the disk space availability?

  1. du

  2. dir

  3. df

  4. none of the above


Correct Option: C
Explanation:

The df reports free disk space. The available space in a hard disk is determined by du command.

Which command is used for remote accessing the program?

  1. X-host

  2. Ping

  3. StartX

  4. FTP


Correct Option: A
Explanation:

 Xhost is used to access remote program.

Which of the following operators represents equality relational operator?

  1. =

  2. ==

  3. - eq

  4. None of the above


Correct Option: C
Explanation:

 -eq checks relation between two operands . Checks if the value of two operands are equal or not, if yes then condition becomes true. Example - [ $a -eq $b ] is not true. if a=10 and b=20.

Which command is used to start X server manually?

  1. startX

  2. beginX

  3. touch

  4. mailx


Correct Option: A
Explanation:

 The startX command is used to start X server manually in unix system.

How can we search order of a command?

  1. By PATH command

  2. By FIND command

  3. By HEAD command

  4. By Tail command


Correct Option: A
Explanation:

 PATH is used to search the order of the command.

In which block is available free inode number found?

  1. Boot block

  2. Super block

  3. Inode block

  4. Data blocks


Correct Option: B
Explanation:

The super block contains information about the entire disk and the I-node list -a list of inodes. The super block also contains an array to represent free inodes.

Which of the following keys lets one know the line number of current cursor position in vi editor?

  1. <ctrl> g

  2. <ctrl> j

  3. <ctrl> d

  4. <ctrl> k


Correct Option: A
Explanation:

 <ctrl> g -  to know the line number at any instant, we use ctrl g .

- Hide questions