Assignment 3.doc

advertisement
CST334
Due: 2/14
ASSIGNMENT 3
Chapter3
Name:
In this assignment, you’re going to practice moving through directories and moving files through
directories. Fill in your answers as you work them out while logged into mlc104. FOLLOW
INSTRUCTIONS AND DO THEM EXACTLY ON MLC104. Part of your grade will be based on
evidence obtained from your home directory.
1. In your home directory, make three copies (one at a time)
of your foods file: breakfast, lunch, dinner
_________________________
_________________________
_________________________
2. Make three subdirectories(one at a time) : alpha, beta, gamma
_________________________
_________________________
_________________________
3. From your home directory, copy breakfast and lunch (one at a time) into alpha
_________________________
_________________________
4. Move (mv) dinner into beta _________________________
5. Prove that you were successful_________________________
6. Change directories to gamma _________________________
7. STILL IN GAMMA, Copy breakfast from the parent directory into the working directory. Use .
to abbreviate the working directory ________________________
8. STILL IN GAMMA, Copy dinner from beta directory into the working directory
__________________
9. WITHOUT leaving gamma, copy dinner from beta to alpha ______________________
10. Remove all the files in alpha (from gamma or by moving to alpha first)
_________________________
11. remove the directory alpha _________________________
12. Change dir to cst334 directory. Draw a map of the cst334 directory. Use ls -F and cd
subdirectory to display and navigate the subdirectories. Your map should show ONLY
subdirectories. Are there any hidden files?
13. (2 points extra credit) scavenger hunt: somewhere in the cst334/as3 directory is a file that
contains the text ‘hierarchical file system’ for two points extra credit
a) find this file and write down the absolute path name:________________________ (think grep)
b) Write a command (or several commands) that copies the file to your home
directory_______________________________________
/
bin
cp
etc
home
beth
bin
hls
csis82
log.txt
alex
csis80
bin
assign.txt
task
csis10A
todo.txt
Advanced Directory Navigation/Copy/Move Commands
14) Assume you have access to all the directories in the above tree. Using absolute pathnames,
list the contents of
a) alex's home directory _________________________
b) hls's task directory ___________________________
c) the /bin directory _____________________________
15) If you are in hls's csis80 directory, using relative path names, change directory to
a. the task directory______________________
b. hls's home directory directory__________________
c. beth's csis82 directory (don't use ~) ________________________
16) Using absolute pathnames, copy todo.txt into the csis82 directory
____________________________________________________________________
17) Using relative path names from directory Alex, copy log.txt into the csis10A directory
____________________________________________________________________
Download