cd Exercise:
type in the command in the
Command input field that accomplishes the
given task
|
Tasks:
(You starts with current directory =
/home/bob)
- Starting in
bob's home directory,
use a absolute path
to change the current directory to
sally's home directory
Now list the content of the current directory
- From sally's home directory,
use a relative path
to change the current directory to
bob's home directory
Now list the content of the current directory
- From bob's home directory,
use a relative path
to change the current directory to
sally's "music" directory
Now list the content of the current directory
- From sally's "music" directory,
use a relative path
to change the current directory to
bob's "photos" directory
Now list the content of the current directory
|
Students should learn to launch all of these three applications
(ask the TA for help if necessary):
- a terminal,
- firefox, and
- a file browser.
|
(For the file browser, they may need to
double-click the
desktop "Documents" icon, and then click
"Up" to see their
home directory.)
Using the file browser, you can visually traverse the tree
structure of the file system (please read
Cheung's notes
for details).
Students should try out these commands by themselves
inside a terminal:
(anything after
with '#' is a comment,
and does not need to be typed):
pwd # print working (current) directory
# Notice the output: /home/yourid
ls # list
# Notice the output
ls -l # list, long format
# Notice the output
ls / # list the root director
# Notice the output
cd cs170 # change current directory (it should exist)
# Should be empty....
pwd
# Notice the output: /home/yourid/cs170
ls
mkdir lab1 # create a subdirectory
ls
cd lab1
pwd
ls # Should be empty
touch myfile # create an empty data file
ls # Can you see the file name ?
cd # Can you guess which is the current directory ?
pwd # Did you guess correctly ?
cd /home/cs170002/share
ls
touch myfile # this should fail for students
ls /home # /home contents depend on machine
|
TODO
Whether you finish the exercise or not, in the last ten
minutes students should must
send us an email (because it is
a useful
skill for getting help later).
How to send emails:
This is what I want in the email:
To: cs170002@mathcs.emory.edu
Subject: lab1
|
In the body of the email, copy-and-paste
the terminal window
contents (the result of whatever commands, mistakes OK).
Note:
Do not use the email address: "cs170002@emory.edu"
******* The emory.edu domain does not work **********
|
How to copy-and-paste in UNIX:
- To
copy from the terminal, you first select the text with the
left mouse button
(it scrolls, so you can select more than
just the visible text).
- Copy the selected text with
Control-Shift-E
(or the Edit menu, or the "Copy" button),
- Now paste the copied text into the webmail message (with Control-V,
or the "Paste" key).
|