[Test] oDesk Unix Test Questions and Answers

Here is oDesk Unix Test with score 3.40 of 5 (Passing Score was 2.50).

August, 2012

Attention: For use only educational purposes!

Topic Correct Answers(%)
Basic Concepts and Administration 67%
Commands 86%
File Commands 75%
Filters 50%
Filters and Shells 75%

If anyone knows which answer is incorrect please write as comment.

Question 1: 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

Question 2: 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

Question 3: 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

Question 4: Which command is used to run a command at a specified time?

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

Question 5: 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

Question 6: 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

Question 7: 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

Question 8: Which of the following statements is incorrect regarding the UNIX environment?

a. It has the provision of security through the login and passwd 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 forfile-name expansion.

Question 9: 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

Question 10: 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

Question 11: What control character signals the end of the file ?

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

Question 12: 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<
c. mail raven«abc
d. mail raven abc

Question 13: 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

Question 14: Which command prints the current working directory ?

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

Question 15: 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

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

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

Question 17: 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.

Question 18: 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.

Question 19: 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

Question 20: 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

Question 21: 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

Question 22: Which command is used for splitting a file horizontally?

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

Question 23: 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

Question 24: By which command can you move to a different directory ?

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

Question 25: 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

Question 26: 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.

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

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

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

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

Question 29: 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. \

Question 30: 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

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

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

Question 32: 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

Question 33: Which command gives all differences between two files ?

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

Question 34: What is the file descriptor for the standard output file ?

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

Question 35: Which command enables you to concatenate files ?

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

Question 36: 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.

Question 37: Which of the following is not a filter?

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

Question 38: 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

Question 39: 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

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

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


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.