Moving and Copying Files
Let’s say you are this file: /r4ds/do4ds/cohort1/chapter8.Rmd
File System Root | Drive | Home Folder | Folder (Your Room) | File |
---|---|---|---|---|
/ | r4ds | do4ds | cohort1 | chapter8.Rmd |
What if you do some remodeling at home?
The rm
command will remove something, with the options to do so recursively (-r
) or to force it (-f
). You can also copy (cp
), move (mv
), or make or remove directories (mkdir
and rmdir
).
Construction Phase | Command |
---|---|
Move everything out of the kitchen into a spare room | mv ~/kitchen/* ~/spare_room |
Remove the kitchen appliances | rm ~/kitchen/stove.app ~/kitchen/fridge.app |
Demolish the kitchen | rmdir ~/kitchen |
Make a new kitchen | mkdir ~/kitchen |
Move everything into the new kitchen | mv ~/spare_room/* ~/kitchen |
You mv
or cp
from_here to_here