MultiUser Ops Sys - Chap 7 labs

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

You need to make the shell script executable. Which of the parameter along with the chmod command should you use?

+x

Which are two methods to execute a shell script named plab.sh?

./plab.sh bash plab.sh

Which of the following file is executed when a login shell exits?

.bash_logout

Which of the following is activated when the user logs on and also loads the environment variables?

.profile

What is the extension of a shell script?

.sh

Which of the following is the global profile used for all the users in a Linux system? /etc/hosts /etc/bash /etc/users /etc/profile

/etc/profile

Which command should you enter to save and exit a file that is opened in the vi editor?

:wq

The output of a command is redirected to a new file with the help of the _____ operator.

>

To send the content of one file to another file, you can use the _______ redirector.

>

Which operator will overwrite the contents of an existing file?

> operator

To append the information to an existing file, which type of redirector should be used> > >> << <

>>

Which operator will append the output to the same file without overwriting it?

>>

Which of the following standard input value is used for the default keyboard? 2 1 3 0 4

A standard input value 0, which is the default keyboard A standard output value 1, which is the default terminal Standard output for errors value 2, which is the default terminal

Which two standard output values are used for the default terminal? [Choose two.] 4 3 1 2 0

A standard input value 0, which is the default keyboard A standard output value 1, which is the default terminal Standard output for errors value 2, which is the default terminal

A variable is mainly used for storing data on a temporary basis in memory.

A variable can hold different types of data, such as characters, white spaces, alphanumeric characters, special characters and so on.

Which value with the chmod command will make a shell script executable? 444 100 400 700

Before a shell script can be executed, the user must make the shell script executable. chmod 755

Variables are of two types:

Environmental variables are defined for the current shell. These variables are then inherited and used by the child shells and the processes. On the other hand, shell variables work within the shell in which they are defined.

If the ~/.bash_profile does not exist, then the __________ file is read.

If the ~/.bash_profile does not exist, then the ~/.bash_login file is read.

Which variables are contained in /etc/profile?

PATH HISTSIZE USER MAIL HOSTNAME

The default output of a command is displayed on the _______. [Choose all that apply.] Console Screen

The default output of a command is displayed on the monitor. However, the user can also choose to redirect the output to a file. (correct answer is currently console and screen-4/18/20)

The _______ command is another filter that converts tabs to spaces, without affection the source file. By default, a tab consists of eight spaces.

The expand command is another filter that converts tabs to spaces, without affection the source file. By default, a tab consists of eight spaces.

The _______ command is used to define the uniform spacing between words and sentences.

The fmt command is used to define the uniform spacing between words and sentences. When used with the -u parameter, it formats the text with one space between words and two spaces between sentences.

The ______ command is used to display a specific number of lines of a file.

The head command is used to display a specific number of lines of a file. In addition, you can use this command to display a specific number of initial lines from multiple files. The output of these files is displayed in the sequential order in which they are defined.

The _______ command to display the combined contents of the specified files.

The join command to display the combined contents of the specified files. The join command combines the contents of each line of the source files and displays the output as a combined-single line for each line in the source files. The join command is more like a SQL join where the data is drawn from multiple tables and displayed as a combined result.

Which operator is typically used with the xargs command?

The xargs command generates an argument list using standard input for a command. The xargs command is typically used with a pipe | operator.

The _________ gets executed only during a login shell.

The ~/.bash_profile gets executed only during a login shell.

The ____ profile is the user configuration file in which the user environment can be configured.

The ~/.bash_profile is the user configuration file in which the user environment can be configured

When using the output redirect > on an existing, the contents of the file will be replaced.

True

Using the ________ command, you can view the file in different number formats, namely octal, hexadecimal, or any other.

Using the od command, you can view the file in different number formats, namely octal, hexadecimal, or any other. The -t parameter is used to specify the type of output. The c parameter displays the ASCII characters.

Which of the following is used for combining two outputs?

You can also combine the output and error or simply two outputs using &.

When using two output redirects, >>, on an existing file, the file contents will be ___________.

appended

In a scenario, where you have multiple conditions, it is best to use ________ statements.

case...esac

The ________ command is another filter that is used to print the selected output of a file onto the screen.

cut

Which command will list the environment variables?

env

Which command prints the all exported environment variables?

env: Prints all exported environment

Which command enables you to export variables to be used by other processes?

export

The if decision construct will always end with the statement __________.

fi (if reversed)

The ______ loop runs through a list of values in a list until the time list values are exhausted.

for loop

You can use the ______ loop to check for a condition and perform a task.

if

The _______ statements are mainly used for making a decision and therefore, are known as decision-making statements.

if...else

We asked the user to enter a positive or negative number and used 4 as an example Given what you know about the script, the number 5 would be classified as a _______ number.

positive

Which command prints partial or full environment variables?

printenv: Prints full or partial environment.

Which command prints the name and value of each shell variable available?

set: Prints the name and value of each shell variable available.

The | (pipe) metacharacter take the place of the stdout of a command and sends it to another command as _______________.

stdin

Bash contains two different kinds of files

system-de configuration files individual user configuration files

You can use ________ to convert the spaces back to default tabs in a file.

use unexpand to convert the spaces back to default tabs in a file

Which of the following executes a list of commands repeatedly till the specified condition is reached?

while

Which two loops run until a statement becomes true? [Choose two.]

while loop until loop


संबंधित स्टडी सेट्स

The 7 Ideas that Shook the Universe Final Exam Part 2 of 3

View Set

CHEMISTRY- exam (old test questions)

View Set

Chap 1 problem set August 2016 Xu Microecon GCSU

View Set

BUSI 230 - FINAL Terminology Practice

View Set

Real Estate Exam Prep Chapter 3: Property valuation and financial analysis

View Set

Perry: Chapter 4: Reproduction Systems Concerns EAQ

View Set