confused about when to use cd ~/whatever or cd /whatever
Hi everyone!
I'm confused. Sometimes in the terminal I have to type in cd ~/ to get to the directory i want, and sometimes cd / for example, cd /boot or cd /bin works, but cd ~/bin or cd ~/boot does not however cd ~/Dropbox or cd ~/Documents works, but cd /Dropbox or cd /Documents doesn't. can someone explain this to me? Thanks for looking at my question, Loren |
Try this and see if it helps
Code:
echo ~ |
The symbol ~ means your user /home directory.
Quote:
Quote:
It depends also on where you are starting from. If you have a directory named junk in your /home/user/Documents directory you can get to it by simply typing: cd junk IF you are in the /home/user/Documents directory. You can access anything by using the full path from anywhere in the system. |
Thank you so much.
It is quite revealing when the curtain is pulled back just a bit, and I realize how much I don't know. I didn't realize that in my original post, when the cd paths I used worked, it was because i was typing in the exact correct path. See, what I thought was happening was something magical. like by typing cd /loren for example, that i would be magically transported there, regardless of my starting point. It would be nice, but what if there where two "loren" directories, in different places, right? how would that work? luck of the draw? Anyway, thanks. loren |
I've found pwd to be a useful command. It stands for print working directory and will tell you what directory you are currently in.
This page gives you a number of useful tricks for using the cd command. I am particularly fond of Code:
cd .. |
All times are GMT -5. The time now is 03:28 AM. |