Unix - Application Developers

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Analytiks
A
Analytiks
Community Contributor
Quizzes Created: 2 | Total Attempts: 525
Questions: 35 | Attempts: 304

SettingsSettingsSettings
Operating System Quizzes & Trivia

Technical Questionnaire for UNIX Application Developers


Questions and Answers
  • 1. 

    Which of the following UNIX commands will not take the user student5 to his personal home direcotry:

    • A.

      Cd

    • B.

      Cd /~

    • C.

      Cd ~

    • D.

      Cd ~student5

    Correct Answer
    A. Cd
    Explanation
    The command "cd" alone will not take the user student5 to his personal home directory. The "cd" command without any arguments will take the user to their default home directory, but it will not specifically take them to their personal home directory.

    Rate this question:

  • 2. 

    What is a shell in UNIX:

    • A.

      A program through which users can issue commands to UNIX.

    • B.

      A window management system.

    • C.

      The logn screen.

    • D.

      The thing that rides on the back of a turtle in UNIX.

    Correct Answer
    A. A program through which users can issue commands to UNIX.
    Explanation
    A shell in UNIX is a program that allows users to interact with the operating system by issuing commands. It provides a command-line interface where users can type commands and execute them. The shell interprets these commands and communicates with the operating system to perform the requested actions. It acts as an intermediary between the user and the kernel of the operating system, enabling users to control and manage various aspects of the UNIX system.

    Rate this question:

  • 3. 

    What is the generic syntax for all UNIX commands:

    • A.

      Command name, followed by arguments, followed by options

    • B.

      Command name, followed by arguments,

    • C.

      Command name, followed by options

    • D.

      Command name, followed by options, followed by arguments

    Correct Answer
    A. Command name, followed by arguments, followed by options
    Explanation
    The generic syntax for all UNIX commands is to have the command name followed by arguments, followed by options. This means that the command is specified first, followed by any required arguments or parameters, and then any optional options or flags.

    Rate this question:

  • 4. 

    Which of the following represents an absolute path:

    • A.

      ./home/file.txt

    • B.

      Bin/cat

    • C.

      Cs2204/

    • D.

      /usr/bin/cat

    Correct Answer
    D. /usr/bin/cat
    Explanation
    An absolute path specifies the location of a file or directory from the root directory of the file system, which is represented by the initial forward slash "/" in Unix-like operating systems. In this case, "/usr/bin/cat" indicates the file "cat" is located in the "bin" directory, which is within the "usr" directory at the root of the file system.

    Rate this question:

  • 5. 

    Which of these commands will set the permissions on file textfile to read and write for the owner, read for the group, and nothing for everyone else:

    • A.

      Chmod 046 textfile

    • B.

      Chmod 640 textfile

    • C.

      Chmod 310 textfile

    • D.

      Chmod rw r nil textfile

    Correct Answer
    A. Chmod 046 textfile
    Explanation
    The command "chmod 046 textfile" will set the permissions on the file "textfile" to read and write for the owner, read for the group, and nothing for everyone else.

    Rate this question:

  • 6. 

    Which of the following is not a UNIX file type:

    • A.

      Plain file

    • B.

      Special file

    • C.

      Batch file

    • D.

      Directory file

    Correct Answer
    A. Plain file
    Explanation
    A plain file is a type of file in UNIX that stores data without any special formatting or structure. It is the most common type of file and can contain text, binary, or any other type of data. On the other hand, special files are used to represent devices or system resources, such as printers or input/output devices. Batch files are scripts that contain a series of commands to be executed in sequence. Lastly, directory files are used to store information about the files and directories within a directory. Therefore, the correct answer is plain file, as it is a valid UNIX file type.

    Rate this question:

  • 7. 

    When the in command is used, which of the following occurs:

    • A.

      A file is created that points to an existing file.

    • B.

      A file is created that is a copy of an existing file.

    • C.

      A file is moved from one location to another.

    • D.

      A file is renamed.

    Correct Answer
    A. A file is created that points to an existing file.
    Explanation
    When the "in" command is used, a file is created that points to an existing file. This means that a new file is created, but it does not contain any new data. Instead, it serves as a reference or shortcut to the original file. Any changes made to the original file will also be reflected in the file created with the "in" command. This allows for easy access and manipulation of the original file without directly modifying it.

    Rate this question:

  • 8. 

    Which command will print the contents of ll files inthe current directory whose names start with the character 'a' and end with a period ('.') followed by any two characters followed by a number:

    • A.

      Is a*.??[0-9]

    • B.

      Is a*.??#

    • C.

      Cat a*.??[0-9]

    • D.

      Cat a?.**#

    Correct Answer
    A. Is a*.??[0-9]
    Explanation
    The correct answer is "Is a*.??[0-9]". This command will print the contents of all files in the current directory whose names start with the character 'a', followed by any two characters, followed by a number. The "?" represents any single character, and "[0-9]" represents any digit from 0 to 9. Therefore, this command will match file names like "aab12" or "axy3", but not file names like "abc" or "axz".

    Rate this question:

  • 9. 

    The apropos command is used to:

    • A.

      Obtain a list of commands whose description contains given keywords.

    • B.

      Change the system language to French

    • C.

      Get help on a particular command.

    • D.

      Create a new binary file.

    Correct Answer
    A. Obtain a list of commands whose description contains given keywords.
    Explanation
    The apropos command is used to obtain a list of commands whose description contains given keywords. This means that if you are unsure of the exact command name, but you know a keyword related to what you want to do, you can use apropos to find the relevant commands. It helps in searching and discovering commands based on their descriptions, making it easier to navigate and use the command line efficiently.

    Rate this question:

  • 10. 

    Which of these is not a common UNIX shell:

    • A.

      Bash

    • B.

      Sh

    • C.

      Fresh

    • D.

      Ksh

    Correct Answer
    A. Bash
    Explanation
    The given question asks for the shell that is not commonly used in UNIX. The shells commonly used in UNIX systems are bash, sh, and ksh. However, "fresh" is not a commonly known UNIX shell, making it the correct answer.

    Rate this question:

  • 11. 

    In ksh, what is the difference between the expressions VAR and $VAR:

    • A.

      VAR refers to a variable name and $VAR to its value.

    • B.

      VAR refers to a variable value and $VAR to its name.

    • C.

      VAR refers to an integer variable and $VAR to a string variable.

    • D.

      Both expressions refer to the same thing.

    Correct Answer
    A. VAR refers to a variable name and $VAR to its value.
    Explanation
    In ksh, the expression VAR refers to a variable name, while $VAR refers to the value of that variable. This means that VAR is used to refer to the actual name of the variable, while $VAR is used to access the value stored in that variable.

    Rate this question:

  • 12. 

    Which of these expressions shows the proper way to add the directory /usr/bin to a path:

    • A.

      PATH+=/usr/bin

    • B.

      PATH=/usr/bin

    • C.

      $PATH:/usr/bin

    • D.

      PATH=$PATH:/usr/bin

    Correct Answer
    A. PATH+=/usr/bin
    Explanation
    The correct answer is "PATH+=/usr/bin". This expression appends the directory /usr/bin to the existing PATH variable, without overwriting it. The "+=" operator is used to concatenate the new directory to the existing value of PATH.

    Rate this question:

  • 13. 

    What is the default datatype of variables in ksh shell scripts:

    • A.

      Integer

    • B.

      Floating point

    • C.

      Character

    • D.

      String

    Correct Answer
    A. Integer
    Explanation
    The default datatype of variables in ksh shell scripts is integer. This means that if a variable is not explicitly declared with a datatype, it is assumed to be an integer by default.

    Rate this question:

  • 14. 

    Which of these situations would cause an error message to be printed after typing the commad "my_script" on the command line.  This assumes that my_script is a ksh script.

    • A.

      My_script dos not have execute permission set.

    • B.

      The current working directory is not in the PATH.

    • C.

      Both a and b.

    • D.

      Neither a nor b.

    Correct Answer
    A. My_script dos not have execute permission set.
    Explanation
    When the command "my_script" is typed on the command line, an error message will be printed if "my_script" does not have execute permission set. This means that the user does not have the necessary permission to execute the script.

    Rate this question:

  • 15. 

    In a ksh script, how is the beginning and end of a block of statements in a while loop indicated.

    • A.

      With { and }

    • B.

      With [ and ]

    • C.

      With while and elihw.

    • D.

      With do and done.

    Correct Answer
    A. With { and }
    Explanation
    In a ksh script, the beginning and end of a block of statements in a while loop are indicated with { and }. These curly brackets are used to enclose the statements that need to be executed repeatedly until the while condition becomes false. The opening curly bracket { indicates the start of the block, and the closing curly bracket } indicates the end of the block. This syntax helps in organizing and grouping the statements within the while loop, making the code more readable and maintainable.

    Rate this question:

  • 16. 

    What is the meaning of the expression ${sports[*]} in a ksh script:

    • A.

      All of the elements of the array sports.

    • B.

      The number of elements in the array sports.

    • C.

      The first element in the array sports.

    • D.

      I love sports!

    Correct Answer
    A. All of the elements of the array sports.
    Explanation
    The expression ${sports[*]} in a ksh script refers to all of the elements in the array named "sports". It does not represent the number of elements in the array, the first element, or a statement about loving sports.

    Rate this question:

  • 17. 

    What is the default list upon which a for loop operates in a ksh script (i.e. a script contains "for x" rather than "for x in y").

    • A.

      The list of files in the current working directory.

    • B.

      The list of currently running processes.

    • C.

      The list of arguments to the script

    • D.

      The list 1, 2, 3, 4, ...

    Correct Answer
    A. The list of files in the current working directory.
    Explanation
    In a ksh script, when a for loop is written as "for x" without specifying a list, the default list upon which the loop operates is the list of files in the current working directory. This means that the loop will iterate over each file in the directory, performing the specified actions for each file.

    Rate this question:

  • 18. 

    What UNIX command is used to update the modification time of a file:

    • A.

      Time

    • B.

      Modify

    • C.

      Cat

    • D.

      Touch

    Correct Answer
    A. Time
  • 19. 

    In which situation can regular expressions not be used.

    • A.

      Filtering of email coming from a particular internet domain name.

    • B.

      Calculation of student grades based on percentaes.

    • C.

      Extraction of all transactions in a database with a customer number of 1000 or less.

    • D.

      Specification of the format of a string representing a zip code.

    Correct Answer
    A. Filtering of email coming from a particular internet domain name.
    Explanation
    Regular expressions can be used in all of the given situations except for filtering email coming from a particular internet domain name. Regular expressions are commonly used for tasks such as pattern matching, string manipulation, and data extraction. However, filtering email based on the domain name requires more complex logic and cannot be efficiently achieved using regular expressions alone. It would require additional programming or filtering techniques specific to email protocols and domain filtering.

    Rate this question:

  • 20. 

    What would be the output of the command:  egrep "^[^A-Za-z].*!" file:

    • A.

      All lines in file beginning with a non-alphabetic character and containing an exclamation point elsewhere on the line.

    • B.

      The number of lines in file beginning with a non-alphabetic character and containing an exclamation point elsewhere on the line.

    • C.

      All lines in file beginning with an alphabetic character and containing a period, an asterisk, and an exclamation point.

    • D.

      The number of lines in file not containing any alphabetic characters before the first exclamation point..

    Correct Answer
    A. All lines in file beginning with a non-alpHabetic character and containing an exclamation point elsewhere on the line.
    Explanation
    The command "egrep" is used to search for lines in a file that match a specific pattern. In this case, the pattern is "^[^A-Za-z].*!", which means the line should start with a non-alphabetic character and contain an exclamation point anywhere else on the line. Therefore, the output of the command would be all the lines in the file that meet this criteria.

    Rate this question:

  • 21. 

    Which string(s) would be matched by the regular expression:| "stu(dent)? [0-9]+".

    • A.

      Student 1

    • B.

      Student

    • C.

      Stu 195819588491

    • D.

      Studentdent 5

    Correct Answer
    A. Student 1
    Explanation
    The regular expression "| "stu(dent)? [0-9]+" matches any string that starts with "stu", followed by an optional "dent", and then a space followed by one or more digits. In this case, the string "student 1" matches the regular expression because it starts with "stu", followed by "dent" (which is optional), then a space, and finally the digit "1".

    Rate this question:

  • 22. 

    Which regular expression (egrep style) means "all lines beginning with a number.

    • A.

      “[^0-9]”

    • B.

      “^[#]”

    • C.

      “^[0-9]”

    • D.

      “[0-9].*$”

    Correct Answer
    A. “[^0-9]”
    Explanation
    The regular expression "^[0-9]" means "all lines beginning with a number". The caret symbol (^) at the beginning of the expression denotes the start of a line, and the [0-9] specifies any digit from 0 to 9. Therefore, this expression matches any line that starts with a number. The correct answer, "^[0-9]", accurately represents the desired pattern.

    Rate this question:

  • 23. 

    Which regular expresion (egrep style) means "all lines containing an alphabetic word ending with ".txt" followed by a space or the end of the line":

    • A.

      "*.txt "

    • B.

      "*.txt( |$)"

    • C.

      "[a-zA-Z]*\.txt( |$)"

    • D.

      "[a-zA-Z]?\.txt\n"

    Correct Answer
    A. "*.txt "
    Explanation
    The correct answer is "*.txt ". This regular expression means that it will match any line containing an alphabetic word ending with ".txt" followed by a space or the end of the line. The asterisk (*) means that there can be zero or more characters before ".txt", the ".txt" matches the literal characters ".txt", and the space matches a space character.

    Rate this question:

  • 24. 

    In order to edit a file called sample.txt, it will be necessary to type:

    • A.

      Edit sample.txt

    • B.

      Vi sample.txt

    • C.

      Sample.txt

    • D.

      Vi qui - TAB.

    • E.

      None of the above

    Correct Answer
    A. Edit sample.txt
    Explanation
    To edit a file called sample.txt, the correct command to type is "edit sample.txt". This command specifies the action (edit) and the file name (sample.txt) that needs to be edited. The other options listed (vi sample.txt, sample.txt, vi qui - TAB, None of the above) do not accurately represent the correct command for editing a file.

    Rate this question:

  • 25. 

    In order to delete a word in a file using vi, place the cursor on the first letter of the word, ESC and type:

    • A.

      Dw

    • B.

      A

    • C.

      X

    • D.

      Z

    • E.

      None of the above.

    Correct Answer
    A. Dw
    Explanation
    In order to delete a word in a file using vi, the user needs to place the cursor on the first letter of the word and then press the keys "dw". The "d" key is used to delete and the "w" key is used to specify that a word needs to be deleted. The other options mentioned in the question ("a", "x", "z" and "None of the above") are not the correct sequence of keys to delete a word in vi.

    Rate this question:

  • 26. 

    In vi, in order to make changes to a file and then save the work, type:

    • A.

      ESC - :wq

    • B.

      :w!

    • C.

      :quit

    • D.

      :save

    • E.

      ALT FS

    Correct Answer
    A. ESC - :wq
    Explanation
    To make changes to a file and save the work in vi, the correct command is "ESC - :wq". The "ESC" key is used to enter command mode, and then ":wq" is typed to save the changes and exit the editor. This command combination ensures that any modifications made to the file are saved before exiting vi.

    Rate this question:

  • 27. 

    Which command would delete a single line:

    • A.

      Del

    • B.

      DELETE

    • C.

      Dl

    • D.

      Er

    • E.

      None of the above

    Correct Answer
    A. Del
    Explanation
    The correct answer is "del" because it is a command commonly used in computer systems to delete files or directories. It is short for "delete" and is often used in command-line interfaces to remove a single line or a specific file. The other options provided, such as "DELETE," "dl," and "er," are not recognized commands for deleting a single line. Therefore, "del" is the appropriate command in this scenario.

    Rate this question:

  • 28. 

    Why should macros (variables) be used in a Makefile?

    • A.

      A single change to a macro can have a large effect on the way a target is built.

    • B.

      Macros can be used to override some of make’s defaults.

    • C.

      Correct use of macros allow a Makefile meant for one purpose to be easily converted for use in another context.

    • D.

      All of the above.

    Correct Answer
    A. A single change to a macro can have a large effect on the way a target is built.
    Explanation
    Macros (variables) should be used in a Makefile because a single change to a macro can significantly impact the way a target is built. By modifying a macro, developers can easily customize the build process and adapt it to different requirements. This flexibility allows for efficient and dynamic development, as macros can be easily adjusted to meet specific needs. Additionally, macros can override make's defaults, providing further control over the build process. Overall, the correct use of macros enables the Makefile to be easily converted for use in different contexts, enhancing its versatility and reusability.

    Rate this question:

  • 29. 

    In UNIX, a "process" refers to:

    • A.

      Compiled source code.

    • B.

      Uncompiled source code

    • C.

      An executing instance of a program

    • D.

      An executable file.

    Correct Answer
    A. Compiled source code.
  • 30. 

    The term for an integer that defines the execution priority of a process is:

    • A.

      Nice value

    • B.

      Pvalue

    • C.

      Importance index

    • D.

      Run number

    Correct Answer
    A. Nice value
    Explanation
    The term for an integer that defines the execution priority of a process is "Nice value". The Nice value is a parameter in Unix-like operating systems that is used to indicate the priority of a process. It ranges from -20 (highest priority) to +19 (lowest priority). A lower Nice value means a higher priority, and a higher Nice value means a lower priority. The Nice value allows the operating system to allocate resources efficiently and prioritize processes based on their importance or urgency.

    Rate this question:

  • 31. 

    Which UNIX system call is used to create a new process:

    • A.

      Creat()

    • B.

      New()

    • C.

      Open()

    • D.

      Ork()

    Correct Answer
    A. Creat()
    Explanation
    The correct answer is "fork()". The fork() system call is used in UNIX to create a new process. It creates an exact copy of the currently running process, including all its memory, file descriptors, and other attributes. The new process, called the child process, starts executing from the same point as the parent process, but with a different process ID. The fork() system call is commonly used in UNIX systems for creating multiple processes and implementing features like multitasking and multiprocessing.

    Rate this question:

  • 32. 

    Pipes are an example of what inter-process communication paradigm?

    • A.

      Message passing

    • B.

      File sharing

    • C.

      Shared memory

    • D.

      Smoke signals

    Correct Answer
    A. Message passing
    Explanation
    Pipes are an example of the message passing inter-process communication paradigm. In this paradigm, processes communicate by sending and receiving messages to each other. Pipes provide a unidirectional communication channel between processes, where one process writes to the pipe and the other process reads from it. This allows for the exchange of data and synchronization between processes.

    Rate this question:

  • 33. 

    Most UNIX system configuration files are located in which directory:

    • A.

      /

    • B.

      /config

    • C.

      /etc

    • D.

      /startup

    Correct Answer
    C. /etc
    Explanation
    The /etc directory is the traditional location for system-wide configuration files on UNIX and Linux systems. These files control the behavior of the operating system, applications, and services. Examples include files for setting up network interfaces, user accounts, and system logging.

    Rate this question:

  • 34. 

    System administration tasks must generally be performed by which username:

    • A.

      Admin

    • B.

      Root

    • C.

      Nobody

    • D.

      Sysadm

    Correct Answer
    A. Admin
    Explanation
    The correct answer is "admin" because the term "admin" is commonly used to refer to the administrator or system administrator role in computer systems. The admin user typically has elevated privileges and permissions to perform various system administration tasks, such as managing user accounts, installing software, configuring system settings, and maintaining system security. It is important to have a dedicated admin user to ensure proper management and security of the system.

    Rate this question:

  • 35. 

    Which of the following pieces of informaiton is not contained in the passwd file?

    • A.

      A user’s unencrypted password

    • B.

      A user’s login name

    • C.

      A user’s preferred shell program

    • D.

      A user’s group ID

    Correct Answer
    A. A user’s unencrypted password
    Explanation
    The passwd file contains information about a user's login name, preferred shell program, and group ID. However, it does not contain a user's unencrypted password. The passwd file stores an encrypted version of the password for security reasons.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Sep 30, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 02, 2009
    Quiz Created by
    Analytiks
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.