Educate yourself online!

Attention!

For new updates please visit http://www.shortquiz.blogspot.com


Unix Test

By on 22:11

Unix Test


 

What is the default standard error file?

a. err
b. error
c. stderr
d. errfile
e. errdev

What is the user id of a root user?

Top of Form
a. 0
b. 1
c. 2
d. 3

Which of the following commands can be used to see the detailed information on how to use a particular command?

a. $ man
b. $ show
c. $ details
d. $ help

UNIX offers the following benefits:

Top of Form
a. Time-sharing
b. Multi-tasking
c. Multi-programming
d. a and b.
e. a,b and c.

Which of the following characters can be used to run multiple commands on a single line?

a. /
b. :
c. ,
d. ;

Which of the following statements is not true regarding UNIX?

a. The kernel does not incorporate a command interpreter.
b. There can only be one command interpreter.
c. UNIX uses a utility program called the shell to provide the user interface.
d. The shell includes features such as interactive processing and background processing.
e. There are various kinds of shells.

In UNIX , shell is a program which :

a. reads a command line from the standard input and interprets it according to a fixed set of rules.
b. is a framework into which functions or utilities can be added when required.
c. is the interface between the user and the kernel.
d. a and b.
e. a and c.

A single command which lists all files in a directory, distinguishing between a directory, executable and symbolic link files is:

a. ls -l
b. ls -F
c. ls -o
d. ls -r
e. ls -h

The command

        ls | more

        displays a list of:

a. all the files in the current directory
b. all the files in the current directory one line at a time
c. all the files in the current directory one screen at a time
d. all the files in the current directory and then waits for the next command
e. all the files in all the directories.

You have two variables, v1 and v2. You want to assign the value of v2 to v1.Which of the following declarations is correct?

a. v1=v2
b. v1=$v2
c. v1=${v2}
d. a or b.
e. b or c.

Which of the following statements is incorrect regarding the UNIX environment?

a. It has the provision of security through the login and password programs.
b. In it the file names are not case insensitive.
c. It has the provision of various commands and utilities for file and directory manipulation.
d. It does not allow relative path names.
e. It allows the use of wild-card characters for file-name expansion

The command

        rm -r project

a. deletes the file project from the current directory.
b. deletes all the files from the directory project.
c. recursively deletes the directory project and all its subdirectories.
d. deletes the file project found in all directories.
e. is invalid.

Which file contains the commands that the system executes when a user logs in?

a. $HOME/startup
b. user/init
c. $HOME/.profile
d. etc/startup

Which command would you use if you want to display selective fields from a file?

a. pg
b. wc
c. tr
d. cut
e. tee

The UNIX command

a.out &

runs the program a.out:

a. With highest priority
b. With highest speed
c. Only when no other process is running on the system
d. In the background
e. Is invalid

Which of the following is not a filter?

a. sort
b. grep
c. uniq
d. pg
e. echo

Which wild-card matches one character?

a. *
b. -
c. #
d. ?
e. @

Which option of the sort filter folds lower case characters to upper case?

a. -r
b. -f
c. -n
d. -t
e. -o

What communication command allows a user to communicate with another user logged on by splitting the screen and providing two way communication?

a. talk
b. write
c. chat
d. talkto
e. transmit

Which command is used to run a command at a specified time?

a. timer
b. at
c. time
d. atq
e. dd

Consider the following command

        cat re*

Which of the following files will not be displayed by this command?

a. reminder
b. receipt
c. Receipt
d. recipe-cake
e. re.c

The PID of a process is displayed by the command:

a. ps
b. p
c. pid
d. pd
e. pc

The main objective of a time-sharing operating System like UNIX is to:

a. Minimize the net execution time.
b. Maximize the processor utilization.
c. Minimize the user response time.
d. Minimize the number of instructions required for a process.
e. Minimize the end user's involvement required for a task.

Which command enables you to concatenate files?

a. cp
b. mv
c. concat
d. ls
e. cat

What communication command provides communication to another user logged on by writing to the bottom of their terminal?

a. talk
b. write
c. chat
d. talkto
e. transmit

Pipes is/are:

a. special programs that prevent the system from crashing.
b. disk management utilities.
c. memory management utilities.
d. a special feature by which the standard output of a command or user program can be sent as the standard input to another command or user program
e. special channels for high speed data transfer.

The executable file name for the Bourne shell is:

a. bsh
b. sh
c. csh
d. ksh
e. lsh

Which of the following commands will you use to send the contents of a file named abc to a user named Raven by mail?

a. mail raven>abc
b. mail raven<abc
c. mail raven<<abc
d. mail raven abc

Point out the incorrect statement regarding standard input , output and error :

a. The terminal is the standard source for input and the standard output and
standard error destination for most UNIX commands.
b. All data sources and destinations are treated as files in UNIX.
c. The three standard files have a file descriptor
        0 - standard output file
        1 - standard input file
        2 - standard error file
d. The input , output and error output can be redirected to a file other than the standard file using file descriptors and the > or < symbol.
e. The output and error can be redirected in the append mode to add the redirected output or error to an existing file using the >> symbol.

Which type of users can be associated with each file in UNIX?

a. The file owner.
b. The group owner of the file.
c. Other users who are not part of the group.
d. a and b.
e. a,b and c.

The command to restore files and directories from magnetic tape is:

a. tar        -xv
b. tar        -tv
c. tar        -cv
d. tar        -td
e. tar        -uv

Which option used along with find prompts the user for confirmation before any operation is performed on a file?

Top of Form
a. -name
b. -type
c. -ok
d. -exec
e. -mtime

The wc filter:

a. counts the number of words in a disk file or in the standard input
b. counts the number of characters in a disk file or in the standard input
c. counts the number of lines in a disk file or in the standard input
d. can only be used with one file at a time
Consider the following file listing of file abc1 for a user abc

-rw-------        1        abc        student                10        jan        10:39        abc1

What inference would you make regarding the file access permissions?

a. The group have full permissions.
b. Only the owner has full permissions.
c. Only the owner has read and write but no execute permissions.
d. The group has read and write permissions.
e. Others have read and write permissions.

What is the number of fields in each line in /etc/passwd file?

a. 3
b. 4
c. 5
d. 6
e. 7

Which command prints the current working directory?

a. pwd
b. cd
c. ls
d. mv
e. cp

You want to read through the reference manual. What command will you use?

a. assist
b. help
c. reference
d. aid
e. man

Which command will symbolically link two files in a directory?

a. link f1 f2
b. link -s f1 f2
c. ln f1 f2
d. ln -s f1 f2
e. ln -l f1 f2

UNIX is an example of:

a. Batch processing operating system.
b. Time sharing operating system.
c. Real time sharing system.
d. Single user operating system.
e. Assembly language.

Which command is used by a user to define a printer for their session?

a. Using lpdest environmental variable
b. Using spooler command
c. Using lpadmin command
d. Using printf command

Which character of the grep filter specifies that the pattern preceding it must occur at the end of each line?

a. []
b. ^
c. $
d. .
e. \

What will be the result of command '' rm -r directory/* ''?

a. It will remove the directory and all the files present in that directory
b. It will remove all the files but not the directory
c. It will show an error message
d. None of the above

By which command can you move to a different directory?

a. pwd
b. cd
c. ls
d. mv
e. rm

Which of the following statements is incorrect?

a. UNIX has a facility by which the user can start a task and then proceed to work on other tasks while the system runs the first task in the background and the second task in the foreground
b. UNIX has numerous utility programs for various functions. New utilities can be built effortlessly by combining existing utilities
c. UNIX is not portable from one hardware platform to another
d. UNIX was the first operating system to introduce the concept of a hierarchical file system
e. UNIX offers an excellent variety of tools for software development for all phases, from program editing to maintenenance of software

Which UNIX command provides the type of information contained in a particular file?

a. more filename
b. type filename
c. file filename
d. info filename
e. list filename

The file descriptor of stdin is:

a. 0
b. 2
c. 3
d. 10
e. 20

Which of the following files is configured for login name, login directory and login shell variables?

a. /etc/profile
b. /etc/home
c. /etc/passwd
d. /etc/conf

Point out the incorrect statement regarding standard input, output and error :

a. The terminal is the standard source for input and the standard output and standard error destination for most UNIX commands.
b. All data sources and destinations are treated as files in UNIX.
c. The three standard files have a file descriptor         0 - standard output file         1 - standard input file         2 - standard error file
d. The input , output and error output can be redirected to a file other than the standard file using file descriptors and the > or < symbol.
e. The output and error can be redirected in the append mode to add the redirected output or error to an existing file using the >> symbol.

Which of the following commands can be used to view the calendar of April 2007?

a. $ cal april 2007
b. $ cal april 07
c. $ calendar 4 07
d. $ cal 4 2007

You want to search for the pattern "Newa" or "Newb" or "Newc". Which regular expression will you use with the grep command?

a. "New[abc]"
b. "New[a-c]"
c. "New[^abc]"
d. a or b.
e. b or c.

Which option of the sort filter changes the output to reverse order?

a. -r
b. -f
c. -n
d. -t
e. -o

How can a root user find the password of a user who has forgotten his password?

a. By looking in the etc/passwd
b. By using passwd command
c. It is not possible
d. None of the above

Which command is used for splitting a file horizontally?

a. cut
b. head
c. tail
d. b and c
e. a, b and c

What option of the sort filter would you use if you want to save the output on a disk file?

a. -r
b. -f
c. -n
d. -t
e. -o

Which of the following statements is incorrect regarding variables?

a. Variables have no data type.
b. Variables can be local or global.
c. Variables can be created at the $ prompt or within a shell script.
d. Global variables are created by the global command.
e. Environment variables are created by the shell.

The find command :

a. searches for specific patterns of characters in file.
b. is used for locating words in a file.
c. Is used to locate files in a directory and in all subdirectories of that directory.
d. can only be used by the administrator.
e. is used for locating users in a network.

What would be displayed on the screen if the pwd command is entered when the user is working in the user directory?

a. /
b. home
c. /home/username
d. usr/
e. usr>
f. usr/username

Which of the following is incorrect about the restrictions imposed by the restricted shell?

a. The user cannot move out of the current working directory.
b. The user cannot change the path; execution of programs in directories other than those authorised by the system is prevented.
c. The user cannot specify absolute path-names beginning at the root.
d. The user cannot redirect input or output.
e. The user is not allowed to see the listing of files in his working directory.

You are writing a shell script. For a given condition, you want to terminate a loop. Which command will you use?

a. terminate
b. end
c. break
d. stop
e. exit

Who can change the password of a user account?

a. Administrator
b. The root user
c. All the members of the Administrator group
d. Account owner

Highlight the incorrect statement regarding the uniq command:

a. uniq is a filter.
b. It compares adjacent lines in a sorted file.
c. It can display lines that are unique.
d. It can display lines that are repeated.
e. It automatically sorts the file that is specified.

Which command would make the scope of a shell variable global to the subshells?

a. global
b. export
c. scope
d. grant
e. extend

What is the number of standard file pointers in UNIX?

a. 3
b. 4
c. 5
d. 6
e. 7

The command
        
        rmdir        c-prog

will not work if :

a. c-prog is not empty.
b. c-prog is the current working directory.
c. full pathname is specified with rmdir.
d. a and b.
e. a and c.

Which keystroke combination sends or signals an interrupt request to a process?

a. Ctrl+c
b. Ctrl+d
c. Ctrl+u
d. Ctrl+s
e. Ctrl+q

By which command a user can add a password for his login name?

a. passwd
b. pass
c. chpass
d. password
e. setpass

Which filter will you use to translate a set of charaters to another?

a. grep
b. cut
c. tr
d. wc
e. tee

The command to restore files and directories from magnetic tape is:

a. tar        -xv
b. tar        -tv
c. tar        -cv
d. tar        -td
e. tar        -uv

You want to make a new directory. What command will you use?

a. md
b. makedir
c. mkdir
d. dirmake
e. newdir

Which command invokes a text editor?

a. write
b. edit
c. editor
d. pad
e. vi

Which of the following commands can be used to add the read and write permissions to the user and group classes of a file named abc?

a. chmod ugo +rw abc
b. chomd abc ug -rw
c. chmod ug -rw abc
d. chmod ug+rw abc

What is the file descriptor for the standard error file?

a. 0
b. 1
c. 2
d. 3
e. 4

Which command will you use to see the available routes and their status?

a. show route
b. route status
c. netstat -rn
d. None of the above

Which option of the grep filter prints out all those lines that do not match the pattern specified by the regular expression?

a. -n
b. -c
c. -d
d. -l
e. -v

The user passwords are kept in which file on most Unix systems?

a. /etc/passwd
b. /etc/password
c. /usr/password
d. /bin/passwd
e. /system/password

The command to take a backup of files and directories on magnetic tape is:

Top of Form
a. tar -xv
b. tar -tv
c. tar -cv
d. tar -td
e .tar -uv

You want to specifically search for the character [ . What character(s) would you use in the expression to achieve this?

a. []
b. ^
c. .
d. \
e. $

Which variable contains the system prompt?

a. PS1
b. PATH
c. PROMPT
d. HOME
e. LOGNAME

The shell variable that defines internal field separator is.

a. PS1
b. PATH
c. HOME
d. LOGNAME
e. IFS

Which command gives all differences between two files?

a. filecmp
b. filecompare
c. filediff
d. diff

Which of the following locations store the information about the currently installed Software on a local system?

a. /var/adm/sw/install
b. /var/adm/sw/software
c. /var/adm/sw/recent
d. /var/adm/sw/products

Suppose you have a file named trans and you want to display fields two to four. Which of the following commands will you use?

a. cut -f4-2 trans
b. cut -f2,3,4 trans
c. cut -f2-4 trans
d. a or b.
e. b or c.

Which special variable will display the exit status of the last executed command in Bourne or Korn shell?

a. $#
b. $-
c. $?
d. $$
e. $!

Which command will delete a directory only if it is empty?

a. rmdir
b. rmdir -r
c. rmdir -e
d. rmdir -t
e. rmdir -u

What is the file descriptor for the standard output file?

a. 0
b. 1
c. 2
d. 3
e. 4

Which of the following statements is not true regarding the grep filter?

a. It is used to search a file for a particular pattern of characters and displays all lines that contain that pattern.
b. The pattern that is searched for in the file is referred to as the regular expression.
c. grep can be used without specifying a regular expression.
d. The filenames are optional.In this case grep expects standard input.
e. The -c option prints only a count of the lines that match the pattern.

Which option of the uniq command would you use to display only those lines which have a multiple occurrence?

a. -u
b. -d
c. -c
d. -l
e. -r

Which command is used for changing the ownership of a file or directory?

a. chmod
b. chown
c. owner
d. All of the above

The file oldies-goldies has the details of the sale of books.The records are sorted on the names of the authors and are as follows

        Alexandre Dumas
        Alexandre Dumas
        Alexandre Dumas
        Gerald Durrell
        Giovanni Guareschi
        Giovanni Guareschi
        James Herriot
        Louisa May Alcott
        Louisa May Alcott
        Louisa May Alcott

Based on the above information, what will be the output of the command
        
        uniq -u oldies-goldies ?

a. Gerald Durrell
b. James Herriot
c. Gerald Durrell
    James Herriot        
d. Alexandre Dumas
    Gerald Durrell
    Giovanni Guareschi
    James Herriot
    Louisa May Alcott
e. Louisa May Alcott

Mounting a file system means :

a. Preparing it for backup.
b. Copying all the files from one filesystem to another.
c. Moving all the files from one filesystem to another.
d. Loading a filesystem from backup medium like tape.
e. Providing a link to the filesystem to be mounted so that it appears as a local subdirectory.

Study the following statements and select the incorrect one :

a. UNIX files assume all data to be consisting of streams of bytes.
b. UNIX commands use the system calls for their operations.
c. UNIX adopts a priority based scheduling strategy.
d. UNIX process priorities cannot be changed by the user.
e. The UNIX system call signal is used to handle interrupts.

Which option used along with the find command allows one to perform operations on the files that are located by the find command?

a. -name
b. -type
c. -ok
d. -exec
e. c or d.

Which command will you use to count the number of words in a file?

a. count
b. grep
c. wc
d. word count

Which variable will display the list of the positional parameters?

a. $#  
b. $*  
c. $?  
d. $$  
e. $!

Which of the following commands can be used to change group ownership of a file/directory?

a. chmod
b. chgroup
c. chgrp
d. grpch

What is the correct command to delete all files with two character file-names from the directory /user/group2?

a. rm /user/group2/..
b. rm /user/group2/??
c. rm /user/group2/**
d. rm /user/group2/--
e. rm /user/group2/;;

Which character would be used in the grep filter to specify a pattern which consists of any one of a set of characters?

a. []
b. ^
c. $
d. .
e. \

Which command will you use to see your current group?

a. who am i
b. show group
c. group
d. id

Which command gives location of the first difference between two files ?

a. filecmp
b. filecompare
c. cmp
d. diff
e. filediff

What is the exit code of a successful command?

a. 0
b. 1
c. -1
d. 100
e. 10

Which key combination instructs the shell to terminate the session?

a. ctrl + q
b. ctrl + d
c. ctrl + s
d. ctrl + r
e. ctrl + z

What information does the who am i command display?

a. The user's name.
b. The user's terminal file name.
c. The day the user logged in.
d. The time the user logged in.
e. The day the user logged in the last time.

In which of the following high level languages most of the UNIX is written?

a. C++
b. JAVA
c. PASCAL
d. FORTRAN
e. C

Using which command can you move to a different directory?

a. pwd
b. cd
c. ls
d. mv
e. rm

The number of arguments can be known by which variable?

a. $-
b. $?
c. $!
d. $#
e. $$

Which variable will display the list of the positional parameters?

a. $#  
b. $*  
c. $?  
d. $$  
e. $!

The mv command:

a. changes the name of a file
b. changes the name of a directory
c. moves a file from one location to another
d. a and b
e. a,b and c

Which of the following is not a valid file command ?

a. ls
b. cat
c. mv
d. cp
e. break

Which of the following commands will you use to send the contents of a file named abc to a user named Raven by mail?

a. mail raven>abc
b. mail raven<abc< li=""></abc<>
c. mail raven<<abc< li=""></abc<>
d. mail raven abc

Which of the following is a responsibility of the system administrator?

a. Setting permissions for files and directories
b. Creation of users and group-ids
c. Providing security through the use of passwords
d. a and c
e. a,b and c

Which of the following commands can be used to communicate directly with other users by sending messages?

a. $ msg
b. $ talk
c. $ send
d. $ call

Which screen manipulation command sets the screen to reverse video?

a. tput cup
b. tput smso
c. tput rmso
d. tput blink
e. tput rev

You want to declare a variable vs with the value hello. Which of the following declarations is correct?

a. vs = 'hello'
b. vs='hello'
c. vs=hello
d. a or b
e. b or c

Which of the following statements is incorrect regarding positional parameters?

a. They are used to create generalised scripts.
b. There can be a maximum number of 9 variables.
c. The shift command is used when the number of parameters exceeds 9 to shift the values of variables.
d. Depending upon the number of arguments specified in the command line, the shell will assign values to some or all of the positional parameters.
e. The command name is put into the variable $1.

Which command compresses a file?

a. compress
b. zip
c. pack
d. comp
e. size

Which filter is used to copy the standard input to the standard output and also to a disk file?

a. grep
b. cut
c. tr
d. wc
e. tee

Which of the following statements is incorrect regarding processes?

a. More than one process can be active even if there is only one processor.
b. A background process runs as a child process of the shell.
c. If the parent process is killed,then always, the child process is also terminated.
d. A process can be killed by pressing the ctrl+c keys.
e. A process can be killed by the kill command.

The chmod command:

a. changes the current execution status from the user mode to the kernel mode.
b. makes a file hidden so that it cannot be seen using the ls command.
c. switches the screen from character to graphical mode.
d. changes the access permissions of a file or directory.
e. changes the password of a user.

Which command gives information about space being used by files and directories?

a. sp
b. mem
c. hd
d. du
e. rm

Which error will you see when an NFS client can no longer access mounted file system?

a. File Not Found
b. Stale File Handle
c. Invalid Command
d. File Inaccessible

What control character signals the end of the file?

a. Ctrl+a
b. Ctrl+b
c. Ctrl+c
d. Ctrl+d
e. Ctrl+e

Which screen manipulation command sets the screen back to normal?

a. tput cup
b. tput smso
c. tput rmso
d. tput blink
e. tput reverse

Which file contains the commands run by all users at login?

a. /usr/init
b. /usr/profile
c. /usr/startup
d. /etc/startup
e. /etc/profile

Which command identifies the current working directory?

a. pwd
b. cd
c. dir
d. ls
e. cur

What would be displayed on the screen if the pwd command is entered when the user is in /usr directory?

a. /
b. home
c. /home/username
d. usr/
e. usr>
f. usr/username

Which option of the sort filter performs a numeric sort?

a. -r
b. -f
c. -n
d. -t
e. -o

By which screen manipulation command can you specify the coordinates for the cursor position?

a. tput cup
b. tput smso
c. tput rmso
d. tput blink
e. tput reverse

Which of the following statements is incorrect?

a. UNIX operating system is available on machines with a wide range of computing power, from microcomputers to mainframes.
b. UNIX is a multi-user system designed to support a group of users simultaneously.
c. UNIX uses a hierarchical file structure to store information.
d. At the core of UNIX is the shell, a program controlling the computer's resources.
e. UNIX has facilities called pipes and filters which permit the user to create complex programs from simpler programs.

With regard to UNIX, a process is:

a. the name of a command.
b. the name of the administrator.
c. the name of the UNIX server.
d. a program in a state of execution.
e. another name for a file.

Which of the following statements regarding file naming is incorrect?

File names:

a. should not have a blank, or a tab.
b. can contain digits, a dot, the hyphen or the underscore anywhere.
c. can contain both upper-case and lower-case alphabets.
d. are not case sensitive.

What is the default UNIX prompt?

a. >
b. !
c. #
d. @
e. $

Which of the following shells is typically used for guest logins and in secure systems ?

a. sh
b. csh
c. ksh
d. rsh
e. lsh

What is the default UNIX prompt?

a. >
b. !
c. #
d. @
e. $

0 comments:

Post a Comment