To navigate to your home directory, use "cd" or "cd ~" To navigate up one directory level, use "cd .." To navigate to the previous directory (or back), use "cd -"
To change your current working directory to its parent folder (move one branch down the directory tree): > cd .. To move the file data.
Highlight the files you want to move, press and hold your right mouse button, and drag-and-drop the files to where you want to move them.
setwd('..')
will move up one directory without entering the absolute path. Here's an example
> getwd()
[1] "C:/Users/D/Desktop/EDABaseball"
> setwd('..')
> getwd()
[1] "C:/Users/D/Desktop"
I think you want to move back to the working directory ./parent/Child/
. This can be done in 2 ways, assuming your current working directory is ./parent/Child/A
1) setwd("..")
2) setwd("./..")
3) setwd("./parent/Child")
I also find dirname()
function pretty useful especially if your path is saved in a variable:
mypath <- getwd()
# The path of the parent directory:
dirname(mypath)
Moves up one directory in Linux
setwd("../")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With