1/97
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
When you use find, it is useful to note that some UNIX versions require the ____ option after the file name to display the names of files.
-display
-show
-names
When you no longer need a file, you can delete it using the ____ command.
rm
remove
dl
delete
rm
The cp ____ option creates a symbolic link or name at the destination rather than a physical file.
-s
-y
-l
-n
-s
If you execute ____, the contents of file1 are sorted and the results are stored in file2.
sort file1 -o file2
sort file1 -d file2
sort file1 > file2
sort file1 > file2
sort file1 file2
sort file1 > file2
You can use the ____________________ command to associate lines in two files on the basis of a common field in both files.
Join?
The ____ option of the find command displays files that have been changed within the last n minutes.
-min n
-cmin n
-nmin n
-mmin n
-mmin n
The ____ command is used to look for patterns in files.
awk
find
pattern
search
awk
You can use the ____ command to create empty files.
touch
create
make
null
touch
Moving and renaming a file are essentially the same operation.
True
False
True
this option prevents the touch command from creating a file, if it does not already exist
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-c
when deleting a directory with rm, this option is used to recursively delete its files and subdirectories
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-r
option of the cp command that provides a warning before an existing file with the same name is overwritten
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-i
option of the mv command that overwrites a destination file with the same name, if the source file is newer than the one in the destination
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-u
is an option of the find command
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-name
can be used with cat to combine the contents of two files
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
> (gt;)
combines files side by side
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
paste
option of the cut command used to indicate that a specific character separates the fields
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-d
option of the sort command used to indicate that a specific character separates the fields
paste
-i
> (gt;)
-t
-u
-d
-r
-c
-name
-t
The command rmdir can be used to delete a directory that is not empty.
True
False
False
System administrators and programmers refer to standard output as ____.
sout
stout
stdout
standardout
stdout
When you are moving files, using the -o option with the mv command can be a good idea so that you don't unexpectedly overwrite a destination file with the same name.
True
False
False
The ____ option of the find command displays files that have been changed within the last n days.
-cdays n
-ctime n
-mdays n
-mtime n
-mtime n
UNIX/Linux store data, such as letters, product records, or vendor reports, in flat ASCII files.
True
False
True
To redirect the list of the files in a directory to a file called homedir.list, you enter ____.
ls < homedir.list
ls > homedir.list
homedir.list < ls
homedir.list > ls
ls > homedir.list
When you use cat to combine two files into a third file, the first line of the output contains the first line of the first file followed by the first line of the second file.
True
False
False
To move a file, you use the ____ command along with the source file name and destination name.
rm
rename
mv
move
mv
The ____ option of the paste command is used to specify a different separator as a delimiter.
-t
-o
-d
-s
-d
You can use the ____________________ command to sort a file's contents alphabetically or numerically.
sort
In UNIX/Linux, text files and binary files are considered to be ____ files.
executable
document
regular
dynamic
regular
Character special files are used by input/output devices for communicating one character at a time, providing what is called ____ data.
raw
binary
ASCII
block
raw
The paste command normally sends its output to ____.
stdout
null
stderr
the file indicated as an argument
stdout
When you no longer need a directory, you can use command ____ to remove it.
xtree
rmdir
dldir
deltree
rmdir
A sorting ____ is a field position within each line.
index
key
column
position
key
The join command is used to associate information in two different files on the basis of a common field or ____ in those files.
index
link
column
key
key
The ____ command removes duplicate lines from a file.
grep
dup
uniq
diff
uniq
One way to run a shell script is to make it executable by using the x permission and then typing ____ prior to the script name when you run the script itself.
./
/.
.
..
./
The ____ option of the diff command shows lines surrounding the line that differs.
-d
-D
-c
-C
-c
The ____ redirects the output of one command to the input of another command.
output redirection operator (>)
input redirection operator (<)
pipe operator (|)
tilde (~)
pipe operator (|)
A popular use of pr is to convert lowercase characters to uppercase characters.
True
False
False
The ____ option of the diff command does not compare for blank lines.
-b
-B
-c
-C
-B
1. compares sorted files and shows differences
2. selects lines or rows
3. counts characters, words, or lines in a file
4. selects columns (fields)
5. compares and selects differences in two files
6. formats and prints
7. edits data streams
8. sorts and merges multiple files
9. translates and deletes character by character
Choose from:
comm cut diff grep
pr sed sort tr wc
1. comm
2. grep
3. wc
4. cut
5. diff
6. pr
7. sed
8. sort
9. tr
The ____ command locates identical lines within two identically sorted files.
diff
sed
uniq
comm
comm
The pipe operator can connect several commands on the same command line.
True
False
True
The ____ option of the diff command is used to display the differences side-by-side in columns.
-s
-c
-n
-y
-y
The ____ function within the awk command is used to format output.
out
outln
printf
printf
When using wc, you cannot specify all three options (-l, -w and -c) in the command line at the same time.
True
False
False
What is tr used for?
translates and deletes character by character
You can use the less command with a directory to view its contents one screen at a time, such as less /sbin.
True
False
True
You use the ____ command to search for a specified pattern in a file, such as a particular word or phrase.
find
grep
sed
diff
grep
____ is a full-featured programming language.
Sed
Awk
Emacs
Grep
Awk
____ is a selection command.
uniq
awk
sort
sed
uniq
When using the printf function, ____ indicates that the output is to appear in decimal digits.
%i
-i
%d
-d
%d
By default, each page in the output of pr has a ____-line header, which, by default, contains the current file's name, its last modification date, the current page, and a trailer consisting of blank lines.
three
four
five
six
five
By default, pr formats the specified files into single-column pages of ____ lines.
22
33
55
66
66
To append new lines in sed, you must use the ____ command
a\
-a
\a
>a
a\
Bash is a freeware derivative of the Bourne and ____ shells.
Korn
C
csh
tsh
Korn
The ____ option of the diff command ignores blanks that repeat.
-b
-B
-c
-C
-b
The ____ option of the grep command displays only lines that do not contain the search pattern.
-v
-n
-o
-r
-v
You use the ____ character in script files to mark comments.
tilde (~)
dollar ($)
pipe (|)
pound (#)
pound (#)
When you create a shell script to run in Bash, you can immediately run the script by typing ____ and then the name of the script.
run
sh
start
exec
sh
The ____ option of the uniq command instructs it to generate as output only the lines of the source file that are not duplicated successively.
-d
-s
-o
-u
-u
____ is NOT a selection command.
comm
diff
grep
sed
sed
You can use the vi editor to create script files.
True
False
True
Shell scripts run more quickly than compiled programs.
True
False
False
You can use the < operator to redirect a command's output from the screen to a file.
True
False
False
A ____ is a name consisting of letters, numbers, or characters and is used to reference the contents of a variable.
comment
symbolic name
label
tag
symbolic name
When you assign a value to a variable, you might want to evaluate it by displaying its contents via a(n) ____ operator.
definition
echo
evaluating
evaluating
The ____ command prints a listing of environment and configuration variables.
printenv
printvar
printf
bash
printenv
The ____ command is useful when you want your shell program to automatically remove any temporary files that are created when the shell script runs.
set
export
tput
trap
trap
Logic structures supported by shell scripts include: sequential logic, decision logic, looping logic, and ____________________ logic.
case?
You should omit spaces when you assign a variable without using single or double quotation marks around its value.
True
False
True
The Bash shell offers improved features over the older Bourne and Korn shells and is fully backward compatible with the Bourne shell.
True
False
True
With no options, ____ displays the current listing of Bash environment and shell script variables.
let
set
sh
export
set
Wildcard characters are also known as ____ characters.
bogus
filler
glob
search
glob
The ____ shell, when compared to the other shells, has a more powerful programming interface.
Bourne
Bash
C
Korn
Bash
A high-level language is a computer language that uses English-like expressions.
True
False
True
____ variables are used to store information about the setup of the operating system, and after they are set up, you typically do not change them.
Global
Environment
Configuration
Shell
Configuration
____ operators compare the relationship between two values or arguments.
Evaluation
Comparison
Logical
Relational
Relational
Shell scripts can automatically access variables created and assigned on the command line.
True
False
False
The ____ statement simplifies the selection of a match when you have a list of choices.
if
switch
case
while
case
The UNIX/Linux shell acts as a(n) ____ when reading script files.
compiler
interpreter
assembler
linker
interpreter
The ____ reads the lines of code that the programmer wrote in the source file and converts them to the appropriate machine-language instructions.
compiler
linker
assembler
interpreter
compiler
____ gives the owner read, write, and execute permissions.
chmod 155
chmod 551
chmod 577
chmod 755
chmod 755
Match each item with a statement below.
1. environment variable that identifies the path name for user's home directory
2. environment variable that holds the path name of the program for the type of shell you are using
3. environment variable that contains the absolute path to the Bash shell, such as /bin/bash
4. environment variable that holds the primary shell prompt
5. environment variable that contains the file name containing commands to initialize the shell
6. environment variable that holds the list of path names for directories searched for executable commands
7. bitwise negation operator
8. logical negation operator
9. matches exactly one character, except for the backslash and period
HOME SHELL BASH
PS1 ENV PATH ~ ! ?
1. HOME
2. SHELL
3. BASH
4. PS1
5. ENV
6. PATH
7. ~
8. !
9. ?
A program's high-level language statements are stored in a file called the ____ file.
shell
script
program
source
source
____ variables are those you create at the command line or in a shell script.
Global
Environment
Configuration
Shell
Shell
The ____ command enables you to initialize the terminal display or terminal window, to place text and prompts in desired locations, and to respond to what the user selects from the menu.
put
tput
clear
tclear
tput
If a source file contains ____ errors, it cannot be converted into an executable file.
syntax
debugging
compilation
logic
syntax
To reference a variable, you use a dollar sign ($) in front of it or enclose it in ____.
square brackets ([ ])
curly brackets ({ })
double quotes (“ ”)
angle brackets (< >)
curly brackets ({ })
You use the chexec command to indicate that a (shell script) file can be executed.
True
False
False
Logic structures are also called ____ structures.
decision
sequential
control
programming
control
The ____ statement continues to loop and execute commands or statements as long as a given condition or set of conditions is true.
for
while
esac
case
while
You can use the ____ operator to redirect commands or program error messages from the screen to a file.
1>
2>
3>
4>
2>
To run the myscript shell script located in the current directory, you should enter: ____.
start myscript
/.myscript
run myscript
./myscript
./myscript
System administrators and programmers refer to standard input as ____.
sin
stint
stdin
standardin
stdin
You can complete a project using awk that you cannot complete using a combination of paste, cut, sort, and join.
True
False
True
When you use the paste command, by default, the pasted results appear in columns separated by commas.
True
False
False
The command > accountsfile ____.
deletes de file accountsfile
is not valid in UNIX/Linux systems
displays the contents of the file accountsfile on the screen
creates an empty file called accountsfile
creates an empty file called accountsfile