Shared Flashcard Set

Details

Operating Systems
Chapter 8-14 Multiple Choice
75
Other
Undergraduate 1
05/08/2014

Additional Other Flashcards

 


 

Cards

Term
The command to count number of lines in xyz is
Definition
wc -l xyz
Term
The command to display all the single capital letter filenames is
Definition
ls [A-Z]
Term
The command to copy xxx and yyy files into zzz file is
Definition
cat xxx yyy >> zzz
Term
The command cp xxx yyy
Definition
creates a new i-node number for yyy
Term
The command ln xxx yyy
Definition
creates no new i-node number
Term
The command mv xxx yyy
Definition
The i-node number remains the same, only the filename is changed
Term
The command cat xxx >> zzz
Definition
all of the above
Term
The command ls ?? matches the filename(s)
Definition
AB and ab
Term
The command more xyz
Definition
shows xyz file one page at the time
Term
The cut command is used to
Definition
display specified columns or fields from a file
Term
The paste command is used to
Definition
join files together line by line
Term
The command find / -name "file?" -print
Definition
searches from the home directory
Term
The command find . -name "?" -print
Definition
starts from the home directory, and finds all files with filename ?
Term
The command find / -name "*" -atime -5 -print
Definition
starts from the root directory, and finds all files last accessed less than 5 days ago
Term
The command find . -name "first.cpp" -exec rm {}\;
Definition
starts from the current directory, and deletes all instances of first.cpp
Term
The command to rename the file called Xfile to Zfile is
Definition
mv Xfile Zfile
Term
The command to copy the file called Xfile to Zfile is
Definition
cp Xfile Zfile
Term
The command to display Xfile one screen at a time is
Definition
more Xfile
Term
The command to copy the file called Xfile to Zfile is
Definition
cat Xfile > Zfile
Term
What is the content of the Xfile after the following command is executed?
ls > Xfile
Definition
list of the filenames in the current directory
Term
What is the content of the Xfile after the following command is executed?
date > Xfile
Definition
current date and time
Term
What is the content of the Xfile after the following command is executed?
cat Afile Bfile > Xfile
Definition
Afile and Bfile
Term
The command cat Afile >> Xfile
Definition
appends the Afile to Xfile
Term
What is the content of the Xfile after the following command is executed?
pr Afile > Xfile
Definition
a formatted copy of the Afile
Term
The command cp -i Afile Xfile
Definition
asks for confirmation before copying the files
Term
What is the content of the Xfile after the following command is executed?
ls [Aa]* > Xfile
Definition
list of all the files that start with letter A or a
Term
What is the content of the Xfile after the following command is executed?
ls A?A > Xfile
Definition
list of files such as: AAA ABA AZA
Term
The command rm [a-c]Report
Definition
all of the above
Term
The command to list all the files that have filenames that starts with letter a and ends with a number from 1to 5 is
Definition
ls a*[1-5]
Term
The command to delete all the files that have filenames that starts with letter C or c and ends with a letter Z or z is
Definition
rm [Aa]*[Zz]
Term
The command find . -name Xfile -print
Definition
finds and displays all the files named xfile
Term
The command find . –atime 10 –print
Definition
finds and displays files accessed exactly 10 days ago
Term
The command head -5 Xfile Zfile
Definition
displays the first 5 lines of the Xfile and Zfile files
Term
The command ln Xfile Zfile
Definition
links Xfile to Zfile
Term
The command cut -f 1,3 Xfile
Definition
displays the first and third fields in the Xfile
Term
The command to sort the xyz file in the background is
Definition
sort xyz &
Term
The command to display the number of lines in a file and also save the count in a file is:
Definition
wc -l xyz | tee outfile
Term
. The command to prevent the termination of a background process after the user is logged off is:
Definition
nohup sort xyz &
Term
The command kill -9 0
Definition
terminates all processes including your login shell
Term
The command sort -r -o yourfile myfile
Definition
sorts yourfile in reverse order and saves it in myfile
Term
The command to display your home directory pathname is
Definition
echo $HOME
Term
The command to display the string "? is >> * \" is
Definition
echo \? is \>> \* \\
Term
The command to display your home directory pathname is
Definition
echo $HOME
Term
The command to find the word UNIX in files called File1, File2 and File3 is
Definition
grep UNIX File?
Term
The command sort +1 xyz sorts the xyz file
Definition
on the second field
Term
The command to change the prompt to the string "Next? " is
Definition
PS1="Next? "
Term
The command G
Definition
shows the last command in the history file
Term
The statement PS1="! $"
Definition
sets the prompt sign to show the last event number from the history file
Term
The statement HISTSIZE=100
Definition
none of the above
Term
The command to turn on command line editing options is
Definition
all of the above
Term
The command to set the option to prevent overwriting an existing file is
Definition
set -o noclobber
Term
The command to set the option to prevent accidental log off when using [Ctrl-d] key is
Definition
set -o ignoreeof
Term
The command to display the word UNIX in quotation marks is
Definition
echo " \"UNIX\" "
Term
The file(s) that will be executed by shell before prompt string is displayed is
Definition
.profile
Term
To quotation marks used for command substitution (executing a command) is
Definition
` command ` (single back quotation marks - grave accent)
Term
The command stty kill \^u sets the kill key to
Definition
[Ctrl-u]
Term
The command stty sane sets the terminal values to
Definition
a sensible default values
Term
The command to execute the shell script named myscript is
Definition
sh myscript
Term
The command to execute the shell script named myscript if it is an executable file is
Definition
c and d
Term
The command to execute a program named xyz in the current shell environment is
Definition
.
Term
The command unset myvar
Definition
deletes myvar variable
Term
The command to display the contents of the variable named myvar is
Definition
echo $myvar
Term
The command set one last assigns
Definition
one to $1 and last to $2
Term
The positional variable $# contains
Definition
none of the above
Term
To create an empty (null) variable called xyz you type
Definition
b and d
Term
The command to add the numbers 1 and 10 is
Definition
expr 1 + 10
Term
The output of the command expr xyz = xyz is
Definition
1
Term
Which of the following is a valid variable assignment?
Definition
all of the above
Term
What symbol or character at the beginning of a line indicates a comment line?
Definition
C
Term
Which of the following commands changes the name of the file assigned to a
variable such as: File=memo?
Definition
mv $File ${File}X
Term
The output of the following program is
for number in 10 11 5
do
echo "$number \c"
done
Definition
10 11 5
Term
The output of the following program is
number=2
while [ $number -gt 0 ]
do
echo "$number \c"
number=`expr $number - 1`
done
Definition
2 1
Term
The output of the following program is
number=2
until [ $number -eq 0 ]
do
echo "$number \c"
number=`expr $number - 1`
done
Definition
2 1
Term
The output of the following program is
number=2
if [ $number -eq 3 ]
then
echo "Hi!"
else
echo "Bye!"
fi
Definition
Bye!
Term
The output of the following program is
read x y z
echo z y x
Assume the input to this program to be: What a wonderful day!
Definition
wonderful day! a What
Supporting users have an ad free experience!