Unit 3 - Chapter 8 Study Guide

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What special character represents 0 or more characters on the Bash shell command line? ? : * None of the above

*

If a user modifies the .bash_profile file, it can then be executed to put the changes into effect without logging out, by using the command: bash .bash_profile . .bash_profile set .bash_profile sh .bash_profile

. .bash_profile

Under Bash shell, the environment variable PATH contains the absolute pathnames of: A list of directory paths to be searched to locate an external command Your home directory Your current directory None of the above

A list of directory paths to be searched to locate an external command

The file ".bashrc" is an example of A secret file A system file A private file A startup file A configuration file

A startup file

Under Bash shell, the following command creates a user-defined shell variable, called name, and initializes it to John Doe: export name="John Doe" name= 'John Doe' name= "John Doe" All of the above None of the above because name must be declared before initializing it.

All of the above

What is the character used to separate elements on the Linux command line? Space character Tab character Newline character All of the above None of the above

All of the above

A Bash shell script is: saved in an ordinary UNIX file. consists of shell commands. allows the use of programming logic. supports the use of variables. All of the above.

All of the above.

The command: find /usr -name ace -print > findout & searches for the file: "ace" begins the find search in the directory: "/usr" runs the command in the background. All of the above.

All of the above.

Under the Bash Shell the command: cat myaliases > ronsaka 2> errors will sends any error messages to file "errors" redirects stdout to file "ronsaka" create the file "ronsaka" even if file "myaliases" does not exist. All of the above.

All of the above.

BASH is an acronym for: Bourne Shell Born and Korn Shell Bourne Again Shell Dash Shell None of the above

Bourne Again Shell

The names of the common shell programs in UNIX are: Bourne, Korn, and C shells C , X-Windows, and Bourne shells Bourne, Bash, and T shells. Bourne, Bash, Korn, C, and X Shells.

Bourne, Korn, and C shells

Under Bash Shell, the command: city=Los Angeles Creates a user-defined variable, called city, and initializes it to Los Angeles Creates a user-defined variables city and initializes it to Los, and tries to execute Angeles as a command. Create a user-defined variable, called city, and initializes it to Los and creates a string variable, called Angeles and sets it to a null string. None of the above

Creates a user-defined variables city and initializes it to Los, and tries to execute Angeles as a command.

What is the difference in output between these two command: echo The working directory is `pwd` echo The working directory is $(pwd) The first displays: The working directory is pwd while the second displays the working directory is (pwd) In the first command pwd is expanded to display the working directory, while in the second command the variable pwd is displayed. In the second command the result of the command pwd is placed in parentheses, while in the first there are no parentheses. No difference

No difference

If whoson is a newly created Bash shell script without execute permissions, what command will allow it to be executed? execute whoson run whoson whoson +x whoson None of the above

None of the above

If you are logged into the host: "COIS-Linux" what command will change the default Bash Shell prompt to: "COIS-Linux => " PROMPT=/host /=> PS1=/HOST / +> PS1="/h / => " PS1='\h => '

PS1='\h => '

What is a PID? Personal Identification code Process Identification Number Program Initiation Designation Number Parent Identification Number

Process Identification Number

The Bash Shell command to create variable: "SUM" and assign "0" to it is: set SUM<0 SUM=0 int SUM = 0; new SUM; set SUM=0

SUM=0

The Bash Shell is based upon and compatible with the The Unix Bourne Shell The Korn Shell The C Shell All of the above. None of the above

The Unix Bourne Shell

Why would you want to change your default shell? To use a different programming language. To execute applications more rapidly. To get the different functionality of another shell. To create more hidden files None of the above

To get the different functionality of another shell.

The error message: "permission denied" occurs when: an unauthorized user logs into your account. a file name entered at the shell prompt is not executable. when you misspell a command such as "echo" as "echx". None of the above.

a file name entered at the shell prompt is not executable.

When interpreting your commands, the shell assumes the first word you type on the command line is a valid Linux command name. an option to a command. an option argument to the command. a command argument to a valid command. None of the above

a valid Linux command name.

What command will create an alias name dir which will execute the "ls -al" command? dir = 'ls -al' alias dir='ls -al' alias ls -al = dir alias = dir<ls -al

alias dir='ls -al'

Under Bash shell, the command: export CDPATH=$HOME:$HOME/MyFiles causes: the cd command to search the HOME directory the cd command to search the MyFiles directory (under the HOME directory) the cd command to search the working directory all of the above None of the above

all of the above

Which of the following commands will declare file descripter 2 (stderr) to be a dupblicate of file descripter 1 (stdout) and sends both to the tr command? cat myfile names |& tr "[a-z]" "[A-Z]" cat myfile names 1>&2 > tr "[a-z]" "[A-Z]" cat myfile names 1&2 | tr "[a-z]" "[A-Z]" None of these will work since you cannot combine stdout and stderr under the Bash Shell.

cat myfile names |& tr "[a-z]" "[A-Z]"

What command makes the file: "myaliases" executable? chmod u+x myaliases set -e myaliases set u+x myaliases chmod -e myaliases

chmod u+x myaliases

You can change your default login shell with the following command: set shell setenv shell chsh Both A and B are correct. None of the above

chsh

How do double quotation marks (") differ from single quotation marks (') affect expansion on the command line? single quotations permit variable expansion while double quotations do not. double quotations permit variable and parameter expansion while single quotations suppress all expansions. double quotations suppress all expansions while single quotation permit both variable and parameter expansion. There is no difference between double and single quotations.

double quotations permit variable and parameter expansion while single quotations suppress all expansions.

Which command can be used to display the value of a specific variable? echo cat display type

echo

Which of the following is an example of command substitution? echo `pwd` pwd=/home/user01 $command=pwd echo "pwd"

echo `pwd`

When using the Readline Library under Bash, what is the default editor mode? emacs vim pico ed

emacs

What system calls are made when you run a program from the command line? fork() and exec() init() and bash() process() and exec() ps() and init()

fork() and exec()

What command displays commands from the history list? show history history hs set history

history

What is the name of the root process under Linux? root init parent login

init

The file: /bin/sh on a Linux system: is a copy of the original Bourne Shell. is a link to the Unix /etc/korn shell file. is a link to the /bin/bash file. None of the above

is a link to the /bin/bash file.

What command shows a list of the current processes Linux is executing? ps process set get

ps

Under Bash Shell, the command: echo The current date is `date` creates: an error message screen output with the current date displayed. screen output of "The current date is date" None of the above

screen output with the current date displayed.

Under Bash, how do you turn on the noclobber feature. noclobber="yes" set noclobber set -o noclobber None of the above

set -o noclobber

The list of directories stored in the PATH variable is known as the environment. the search path. the execution path. the metacharacter set. None of the above

the search path.

What is the name of the utility program which will prompt the user for information necessary to set the timezone? tzselect timeset set $TIME timeselect

tzselect

Variables "name" and "place" can be made constant by: use of the readonly command. removing the write permission from each. use of the set +r command. None of the above.

use of the readonly command.

The command: echo \$person will display the value of the person variable. will display the string: "$person" will generate the error message: "$person not found" will search the working directory for the file "person"

will display the string: "$person"


Set pelajaran terkait

open stax bones of the upper limb 8.2

View Set

Science 8: Chapter 4 → Section 2 Review

View Set

Psychology 120 Chapter 10 Memory

View Set

Inverse sine and cosine functions

View Set