CS253 Midterm 2 Review Guide
The major difference between midterm 1 and midterm 2 is that midterm 2 will cover programming. It'll also include linux terminal use, like midterm 1. Consider it a comprehensive midterm. That said, I doubt anybody forgot how to use the early commands, since we've still been using them with regular expressions and such.
Here are a couple examples of the sort of C programming question that might appear:
- What is the output of the following program?
int main(){
char astring = "gorilla monkey goose";
for(int i = 0; astring[i]; i++)
if(astring[i] == ' ')
astring[i] = '_';
puts(astring);
return 0;
}
Write a C program that will unmount a filesystem mounted at /mnt/usb. The manual page for umount is included.
Write a C function that will take a string and returns the index of the first ':' character.
One page of multiple choice, 8 questions
Rest is short answer
Need to know symbols BASH uses. *, &, $ (for variables), " and ', > >> 2> 2>> <
Regular expressions for grep. ., [ ], ^, $, *
Up to 10 pages of notes is allowed, 8.5 by 11 both sides
There are no questions which are purely from the book. A lot of the questions require you to know how a Linux system functions in general. Creativity and reasoning will go a long way toward a good score.
Commands which might appear somewhere on the test (Note: This is a draft list, I haven't written the test at this point)
- cd
- pwd
- ls
- who
- cat
- ssh
- export
- grep
- find
- w
- file
- mv
- man (a manual reading question)
- chmod
- fg
- killall
- ps
- last (Added after class was over)
Pipes are mentioned in multiple questions, so be familiar with how to use these.