make copy of file and place in new directory using relative path
6,407
Solution 1
First: try to write the answer using absolute path, e.g.
cp /path/to/file.xyz /path/to/the/target/file.xyz
Second: in each directory you can find
.
= this directory
..
= parent directory
Third: rewrite the former command using the .
and ..
dirs. Assuming the current dir is /path/to/
we can write:
cp ./file.xyz ../the/target/
Solution 2
Since this is an assignment I'm not going to give you the answer. But I will point out that every directory has two special directory links:
.
(dot): "This directory"..
(dot-dot): "The directory above"
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
-
dhag over 6 yearsHi! Please edit your question to (1) replace the screenshot with text and (2) tell us what you tried.
-
G-Man Says 'Reinstate Monica' over 6 yearsThere are a couple of steps that come before #2: do some research (starting with a review of what you were taught in class) and then try to solve this yourself.
-