Wednesday, May 9, 2018

Upwork Unix Test

1. The wc filter :
Answers:
• counts the number of words in a disk file or in the standard input
• counts the number of characters in a disk file or in the standard input
• counts the number of lines in a disk file or in the standard input
• can only be used with one file at a time
2. Which command compresses a file?
Answers:
• compress
• zip
• pack
• comp
• size
3. Who can change the password of a user account?
Answers:
• Administrator
• The root user
• All the members of the Administrator group
• Account owner
4. Which of the following commands can be used to view the calendar of April 2007?
Answers:
• $ cal april 2007
• $ cal april 07
• $ calendar 4 07
• $ cal 4 2007
5. 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 ?
Answers:
• Gerald Durrell
• James Herriot
• Gerald Durrell James Herriot
• Alexandre Dumas Gerald Durrell Giovanni Guareschi James Herriot Louisa May Alcott
• Louisa May Alcott
6. Which keystroke combination sends or signals an interrupt request to a process ?
Answers:
• Ctrl+c
• Ctrl+d
• Ctrl+u
• Ctrl+s
• Ctrl+q
7. Which command will you use to count the number of words in a file?
Answers:
• count
• grep
• wc
• word count
8. The main objective of a time-sharing operating System like UNIX is to :
Answers:
• Minimize the net execution time.
• Maximize the processor utilization.
• Minimize the user response time.
• Minimize the number of instructions required for a process.
• Minimize the end user's involvement required for a task.
9. Which command gives information about space being used by files and directories ?
Answers:
• sp
• mem
• hd
• du
• rm
10. The chmod command :
Answers:
• changes the current execution status from the user mode to the kernel mode.
• makes a file hidden so that it cannot be seen using the ls command.
• switches the screen from character to graphical mode.
• changes the access permissions of a file or directory.
• changes the password of a user.
11. Which of the following locations store the information about the currently installed Software on a local system?
Answers:
• /var/adm/sw/install
• /var/adm/sw/software
• /var/adm/sw/recent
• /var/adm/sw/products
12. What will be the result of command '' rm -r directory/* ''?
Answers:
• It will remove the directory and all the files present in that directory
• It will remove all the files but not the directory
• It will show an error message
• None of the above
13. What is the exit code of a successful command ?
Answers:
• 0
• 1
• -1
• 100
• 10
14. Which variable contains the system prompt ?
Answers:
• PS1
• PATH
• PROMPT
• HOME
• LOGNAME
15. The mv command :
Answers:
• changes the name of a file
• changes the name of a directory
• moves a file from one location to another
• a and b
• a,b and c
16. Which of the following commands can be used to change group ownership of a file/directory?
Answers:
• chmod
• chgroup
• chgrp
• grpch
17. Which option used along with find prompts the user for confirmation before any operation is performed on a file ?
Answers:
• -name
• -type
• -ok
• -exec
• -mtime
18. The command
        
        rmdir        c-prog

will not work if :
Answers:
• c-prog is not empty.
• c-prog is the current working directory.
• full pathname is specified with rmdir.
• a and b.
• a and c.
19. Which command is used by a user to define a printer for their session?
Answers:
• Using lpdest environmental variable
• Using spooler command
• Using lpadmin command
• Using printf command
20. The command

        ls | more

        displays a list of :
Answers:
• all the files in the current directory.
• all the files in the current directory one line at a time.
• all the files in the current directory one screen at a time.
• all the files in the current directory and then waits for the next command.
• all the files in all the directories.
21. Which special variable will display the exit status of the last executed command in Bourne or Korn shell?
Answers:
• $#
• $-
• $?
• $$
• $!
22. Which variable will display the list of the positional parameters?
Answers:
• $#
• $*
• $?
• $$
• $!
23. Which option of the uniq command would you use to display only those lines which have a multiple occurrence ?
Answers:
• -u
• -d
• -c
• -l
• -r
24. Point out the incorrect statement regarding standard input , output and error :
Answers:
• The terminal is the standard source for input and the standard output and standard error destination for most UNIX commands.
• All data sources and destinations are treated as files in UNIX.
• The three standard files have a file descriptor 0 - standard output file 1 - standard input file 2 - standard error file
• The input , output and error output can be redirected to a file other than the standard file using file descriptors and the > or < symbol.
• 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.
25. Which option of the sort filter performs a numeric sort ?
Answers:
• -r
• -f
• -n
• -t
• -o
26. You want to read through the reference manual.What command will you use ?
Answers:
• assist
• help
• reference
• aid
• man
27. You want to make a new directory.What command will you use ?
Answers:
• md
• makedir
• mkdir
• dirmake
• newdir
28. Which UNIX command provides the type of information contained in a particular file ?
Answers:
• more filename
• type filename
• file filename
• info filename
• list filename
29. Which of the following statements regarding file naming is incorrect?

File names :
Answers:
• should not have a blank, or a tab.
• can contain digits, a dot, the hyphen or the underscore anywhere.
• can contain both upper-case and lower-case alphabets.
• are not case sensitive.
30. Which type of users can be associated with each file in UNIX ?
Answers:
• The file owner.
• The group owner of the file.
• Other users who are not part of the group.
• a and b.
• a,b and c.
31. Which of the following commands can be used to communicate directly with other users by sending messages?
Answers:
• $ msg
• $ talk
• $ send
• $ call
32. Which screen manipulation command sets the screen to reverse video?
Answers:
• tput cup
• tput smso
• tput rmso
• tput blink
• tput rev
33. Consider the following command

        cat re*

Which of the following files will not be displayed by this command ?
Answers:
• reminder
• receipt
• Receipt
• recipe-cake
• re.c
34. Suppose you have a file named trans and you want to display fields two to four. Which of the following commands will you use ?
Answers:
• cut -f4-2 trans
• cut -f2,3,4 trans
• cut -f2-4 trans
• a or b.
• b or c.
35. Which of the following files is configured for login name, login directory and login shell variables?
Answers:
• /etc/profile
• /etc/home
• /etc/passwd
• /etc/conf
36. Which option used along with the find command allows one to perform operations on the files that are located by the find command ?
Answers:
• -name
• -type
• -ok
• -exec
• c or d.
37. Which filter will you use to translate a set of charaters to another ?
Answers:
• grep
• cut
• tr
• wc
• tee
38. Which command will symbolically link two files in a directory?
Answers:
• link f1 f2
• link -s f1 f2
• ln f1 f2
• ln -s f1 f2
• ln -l f1 f2
39. What is the default standard error file ?
Answers:
• err
• error
• stderr
• errfile
• errdev
40. 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?
Answers:
• chmod ugo +rw abc
• chomd abc ug -rw
• chmod ug -rw abc
• chmod ug+rw abc
41. Which command identifies the current working directory ?
Answers:
• pwd
• cd
• dir
• ls
• cur
42. Mounting a file system means :
Answers:
• Preparing it for backup.
• Copying all the files from one filesystem to another.
• Moving all the files from one filesystem to another.
• Loading a filesystem from backup medium like tape.
• Providing a link to the filesystem to be mounted so that it appears as a local subdirectory.
43. What is the file descriptor for the standard error file ?
Answers:
• 0
• 1
• 2
• 3
• 4
44. With regard to UNIX, a process is :
Answers:
• the name of a command.
• the name of the administrator.
• the name of the UNIX server.
• a program in a state of execution.
• another name for a file.
45. Which of the following is incorrect about the restrictions imposed by the restricted shell ?
Answers:
• The user cannot move out of the current working directory.
• The user cannot change the path; execution of programs in directories other than those authorised by the system is prevented.
• The user cannot specify absolute path-names beginning at the root.
• The user cannot redirect input or output.
• The user is not allowed to see the listing of files in his working directory.
46. Which of the following characters can be used to run multiple commands on a single line?
Answers:
• /
• :
• ,
• ;
47. Which command will you use to see your current group?
Answers:
• who am i
• show group
• group
• id
48. Which command will delete a directory only if it is empty ?
Answers:
• rmdir
• rmdir -r
• rmdir -e
• rmdir -t
• rmdir -u
49. Using which command can you move to a different directory?
Answers:
• pwd
• cd
• ls
• mv
• rm
50. Pipes is/are :
Answers:
• special programs that prevent the system from crashing.
• disk management utilities.
• memory management utilities.

No comments:

Post a Comment