Tuesday, 22 September 2015

Unix Test

Unix Test

:: Home > Upwork > Operating Systems > Unix Test

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

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

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

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

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

The command

Is | 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

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

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

What is the exit code of a successful command?

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

What is the file descriptor for the standard error file?

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

Mounting a file system means:

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

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. -I
e. –v

Which command compresses a file?

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

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

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

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

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

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

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

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

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

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

Which of the following is not a valid file command?

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

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

a. Using Ipdest environmental variable
b. Using spooler command
c. Using Ipadmin command
d. Using printf command

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. A
c. $
d. .
e. \

Which variable contains the system prompt?

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

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

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

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

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

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 is used to run a command at a specified time?

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

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

Consider the following file listing of file abc 1 for a user abc

_rw_------       1       abc       student                1Q      jan       10 39       abd

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

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

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

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

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[Aabc]”
d. a or b
e. b or c

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

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

The executable file name for the Bourne shell is:

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

The shell variable that defines internal field separator is.

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

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

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

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

The number of arguments can be known by which variable?

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

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

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

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

Which command is used for splitting a file horizontally?

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