Unix - Application Developers

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Analytiks
A
Analytiks
Community Contributor
Quizzes Created: 2 | Total Attempts: 542
| Attempts: 316 | Questions: 35
Please wait...
Question 1 / 35
0 %
0/100
Score 0/100
1. What is a shell in 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.

Submit
Please wait...
About This Quiz
Unix - Application Developers - Quiz

This UNIX quiz for application developers tests essential skills such as navigating directories, understanding shell functionalities, command syntax, file permissions, and recognizing file types. It's designed to enhance... see morepractical UNIX command line proficiency. see less

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

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.

Submit
3. The apropos command is used to:

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.

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

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.

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

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.

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

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.

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

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.

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

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".

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

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.

Submit
10. System administration tasks must generally be performed by which username:

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.

Submit
11. Which command would delete a single line:

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.

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

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.

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

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.

Submit
14. In which situation can regular expressions not be used.

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.

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

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".

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

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.

Submit
17. Which of the following represents an absolute path:

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.

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

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.

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

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.

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

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.

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

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.

Submit
22. 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.

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.

Submit
23. Which of the following is not a UNIX file type:

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.

Submit
24. 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").

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.

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

Explanation

not-available-via-ai

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

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.

Submit
27. Most UNIX system configuration files are located in which directory:

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.

Submit
28. 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":

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.

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

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.

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

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.

Submit
31. In UNIX, a "process" refers to:

Explanation

not-available-via-ai

Submit
32. What is the generic syntax for all UNIX commands:

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.

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

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.

Submit
34. Which of these is not a common UNIX shell:

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.

Submit
35.
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:

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.

Submit
View My Results

Quiz Review Timeline (Updated): Sep 30, 2024 +

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
Cancel
  • All
    All (35)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is a shell in UNIX:
In ksh, what is the difference between the expressions VAR and $VAR:
The apropos command is used to:
What is the meaning of the expression ${sports[*]} in a ksh script:
Pipes are an example of what inter-process communication paradigm?
In vi, in order to make changes to a file and then save the work,...
When the in command is used, which of the following occurs:
Which command will print the contents of ll files inthe current...
In order to delete a word in a file using vi, place the cursor on the...
System administration tasks must generally be performed by which...
Which command would delete a single line:
Which of the following pieces of informaiton is not contained in the...
What is the default datatype of variables in ksh shell scripts:
In which situation can regular expressions not be used.
Which string(s) would be matched by the regular expression:|...
Which regular expression (egrep style) means "all lines beginning with...
Which of the following represents an absolute path:
The term for an integer that defines the execution priority of a...
Which UNIX system call is used to create a new process:
In a ksh script, how is the beginning and end of a block of statements...
What would be the output of the command:  egrep "^[^A-Za-z].*!"...
Which of these situations would cause an error message to be printed...
Which of the following is not a UNIX file type:
What is the default list upon which a for loop operates in a ksh...
What UNIX command is used to update the modification time of a file:
Which of the following UNIX commands will not take the user student5...
Most UNIX system configuration files are located in which directory:
Which regular expresion (egrep style) means "all lines containing an...
Which of these expressions shows the proper way to add the directory...
In order to edit a file called sample.txt, it will be necessary to...
In UNIX, a "process" refers to:
What is the generic syntax for all UNIX commands:
Why should macros (variables) be used in a Makefile?
Which of these is not a common UNIX shell:
Which of these commands will set the permissions on file textfile to...
Alert!

Advertisement