COSC 109 Final Exam Study
Questions and Answers7
In awk, what is the built-in variable that refers to the number of fields on the current record? -
ANSWERS-NF
In awk, which of the following gives the entire line of the current record? - ANSWERS-$0
Consider this statement which appears in an awk script:
printf("***%10s***%-8.2f***\n","Bob",123.45678)
What will be the corresponding output for this statement? - ANSWERS-*** Bob***123.46 ***
Display the contents of the file Exam.txt. - ANSWERS-cat Exam.txt
What command line would you enter to display all lines in file fum.txt that start with a number,
contains the string "Take 5" and ends with a non-numeric character? - ANSWERS-grep '^[0-
9].*Take 5.*[^0-9]' fum.txt
For all Java files in the current directory, display all lines containing the word Class at the
beginning of the line. Remember that filenames ending with ".java" are Java files. - ANSWERS-
cat *.java | grep '^Class'
File foo.txt and fee.txt are sorted files. Provide a command that displays all lines that are in file
foo.txt but are not in fee.txt - ANSWERS-comm -23 foo.txt fee.txt
, Which DOS command is used to list the names of files in the current folder? - ANSWERS-dir
In the vim editor, what command do you use to save and quit? - ANSWERS-:wq
In the vim editor, what command do you use to move the cursor to the end of the current line?
- ANSWERS-$
In the vim editor, what command would delete the last line of the file? - ANSWERS-Gdd
Which UNIX command is used to provide a second name (like an alias) for a file? - ANSWERS-ln
Which UNIX command is used to list the contents of a file? - ANSWERS-cat
What UNIX command can be used to see which user is the owner of a file? - ANSWERS-ls -l
In UNIX, which of the following is used to redirect the input door of a command to come from
another command's output door? - ANSWERS-|
Which directory is the root directory? - ANSWERS-/
Permissions can be granted to different group classifications. Which of the following is NOT one
of these group classifications? - ANSWERS-Root
5 bits can represent at most ____ different things - ANSWERS-32
The FAT12 file system can have up to_____entries in its File Allocation Table. - ANSWERS-4096
Questions and Answers7
In awk, what is the built-in variable that refers to the number of fields on the current record? -
ANSWERS-NF
In awk, which of the following gives the entire line of the current record? - ANSWERS-$0
Consider this statement which appears in an awk script:
printf("***%10s***%-8.2f***\n","Bob",123.45678)
What will be the corresponding output for this statement? - ANSWERS-*** Bob***123.46 ***
Display the contents of the file Exam.txt. - ANSWERS-cat Exam.txt
What command line would you enter to display all lines in file fum.txt that start with a number,
contains the string "Take 5" and ends with a non-numeric character? - ANSWERS-grep '^[0-
9].*Take 5.*[^0-9]' fum.txt
For all Java files in the current directory, display all lines containing the word Class at the
beginning of the line. Remember that filenames ending with ".java" are Java files. - ANSWERS-
cat *.java | grep '^Class'
File foo.txt and fee.txt are sorted files. Provide a command that displays all lines that are in file
foo.txt but are not in fee.txt - ANSWERS-comm -23 foo.txt fee.txt
, Which DOS command is used to list the names of files in the current folder? - ANSWERS-dir
In the vim editor, what command do you use to save and quit? - ANSWERS-:wq
In the vim editor, what command do you use to move the cursor to the end of the current line?
- ANSWERS-$
In the vim editor, what command would delete the last line of the file? - ANSWERS-Gdd
Which UNIX command is used to provide a second name (like an alias) for a file? - ANSWERS-ln
Which UNIX command is used to list the contents of a file? - ANSWERS-cat
What UNIX command can be used to see which user is the owner of a file? - ANSWERS-ls -l
In UNIX, which of the following is used to redirect the input door of a command to come from
another command's output door? - ANSWERS-|
Which directory is the root directory? - ANSWERS-/
Permissions can be granted to different group classifications. Which of the following is NOT one
of these group classifications? - ANSWERS-Root
5 bits can represent at most ____ different things - ANSWERS-32
The FAT12 file system can have up to_____entries in its File Allocation Table. - ANSWERS-4096