1. State and describe 6 types of redirection. Include examples for each.
2. Explain what each of the following programs do and give examples of its use:
1) crontab 2) make 3) chmod 4) vi 5) gcc 6) paste 7)join
For the following questions: explain what the commands and arguments will do.
3. chmod 754 test.txt c* 2> explained.txt
4. cat testfile.txt | sed -e ‘/s/dog/cat/g’ > animals.txt
5. ANIMALS=`date +%d; echo ‘\ndog cat mouse’`
6. if test –z file.txt; then; echo done; else; touch file.txt;
7. paste –d, names.txt address.txt> book.txt 2> errors.txt
8. The file toys.txt has the permissions - r w - - w - - w – Write the full command to change the permissions on the file for the following questions: (Use the original file permissions given above for each question.)
i. – r w x r w - r - x
ii. - r - x – w x - - x
iii. d r w - r - - - w x
9. Describe the 5 essential steps in creating a new operating system on a machine.
10. What are virtual machines? Describe a few pros and cons of them.
11. Which of the following are valid variable names?
a. _FRUIT_BASKET
b. 1_APPLE_A_DAY
c. FOUR-SCORE&7YEARS_AGO
d. VARIABLE
12. Write a loop that executes a line of code “echo ‘hello there’” once.
13. Explain what types of files are found in the following directories:
a. /dev b. /mnt c. /boot d. /var e./lib
14. Write a for loop that displays a countdown to the screen.
15. Describe the lifecycle of a project under version control.
16. When would we use the following commands in version control (using subversion) and explain what it does:
a. Svn update
b. Svn delete
c. Svn status
d. Svn commit
e. Svn list
17. Create a script that will do the following:
The script will have a menu that continuously loops until they type ‘EXIT’.
The menu will list off simple options for the user:
1. Open a file – the user will then be asked for the filename and the file will be opened on the screen.
2. Edit a file – the user will then be asked for the filename and the file will be opened in the vi editor
3. Move a file – the user will be asked for the filename to move and the location to move the file to; which afterwards the action will be performed.
4. Copy a file – the user will be asked for the filename to copy and the location to copy the file to; which afterwards the action will be performed.
5. Rename a file – the user will be asked for the filename to rename and then the new name for the file.
6. Update a file – the user will be asked for a filename and then the permissions to update the file with; after which the files permissions would be updated (you can do numeric or text)
7. Exit – this should close the loop.
Note:
• Clear the screen and re-display the menu after any requests have been completed or a menu option that is not there is selected.