|
|
CS211 Shell Programming
Review for First Quiz
- What are the 3 main parts of UNIX?
- Larry, Moe and Curly (and sometimes Shemp)
- kernel, file system and shell
- ls, wc and grep
- command.com, file system and kernel
- Which of the following shells is most commonly available, already
installed on a UNIX system?
- Bourne
- Korn
- C
- Bourne-again
- Which shell listed above is started by each of these programs?
- bash ____________________
- csh _____________________
- ksh _____________________
- sh ______________________
- The purpose of the shell is
- to interpret commands
- to protect the user from the files
- to protect the snail from fish
- to carry out commands
- What is the UNIX command to print the value of the variable called
count?
- print count
- echo count
- echo $count
- cat count
- What is the command to take input from the user and store it in the
variable count?
- read $count
- read count
- get &count
- get count
- UNIX file structure is usually compared to...
- a branching tree
- a single folder
- a series of nodes
- a throbbing ache in the lumbar area
- Which characters should not be used in filenames?
- uppercase letters
- lowercase letters
- metacharacters
- underscores and periods
- Which metacharacter best matches a single character in filename expansion?
- question mark
- square bracket
- period
- asterisk
- UNIX files and directories have three kinds of permissions:
- read, copy and execute
- copy, read and write
- read, write and execute
- write, erase and execute
- UNIX permissions apply to three kinds of users:
- owner, group and others
- administrator, owner and group
- friends, Romans and countrymen
- network, LAN, and WAN
- What chmod command would you use on a file to let all system users
execute it?
- chmod 770 filename
- chmod 755 filename
- chmod 716 filename
- chmod 666 filename
- A quick way to create a file from the command line is:
- cat filename
- cat < filename
- cat > filename
- cat: illegal command
- Tell me what the wc command reports in each case:
- cat filename | wc -w ____________________________________
- ls -l | wc -l ___________________________________________
- cat filename | wc -c __________________________________
- head filename | wc _____________________________________
- Shell variables are string variables. Tell me three ways to set the
variable string1 to a null value.
- ________________________________________________
- ________________________________________________
- ________________________________________________
- What do each of the following commands do?
- echo _________________________________________
- tail _________________________________________
- file _________________________________________
- mv ___________________________________________
- Which of these is correct?
- variable 1 = 15
- variable2 = 15
- variable3=15
- 4var=15
- Explain what is wrong with each bad choice in 17.
- ________________________________________________
- ________________________________________________
- ________________________________________________
- Which of these forces a mathematical operation?
- variable2 = $variable1 + 15
- variable2=$variable1+15
- variable2='expr $variable1 + 15'
- variable2=`expr $variable1 + 15`
- Which of the following lists all filenames starting with a c?
- Ls -a c.*
- Ls -a c???
- Ls -a c*
- Ls -a *c*
- Square brackets can enclose sets of allowed characters. What would
each command below list?
- Ls -a [a-c]*_______________________________________
- Ls -a ch[1-4]*_____________________________________
- Ls -a *[.c]________________________________________
- Ls -a ch[1234]_____________________________________
- grep searches for "regular expressions". Which type of quotes should
we use around the regular expression if it contains:
- more than one word _______________________________________________
- special characters we want ignored _______________________________
- special characters we want expanded ______________________________
- Which command means to determine the value of variables before executing
the rest of the line?
- expr
- resolve
- eval
- doit...just_do_it!
- A proper use of the accent grave would be:
- Ls -l `which sh`
- echo `hello, $USER`
- cat > `newfile`
- `Allo, silly English types! `ow you like my accent?
|