LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the meaning of ~ while referring path in linux (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-meaning-of-%7E-while-referring-path-in-linux-887269/)

xombboxer 06-20-2011 02:51 AM

What is the meaning of ~ while referring path in linux
 
I have seen people using ~/xxx/ddd/

i assume it is used to refer any particular path from anywhere, isn't it?

acid_kewpie 06-20-2011 02:55 AM

Code:

# echo ~
/home/dave

your home directory

ssrameez 06-20-2011 03:19 AM

~ - this refers to your home directory.
~xxxx -- refers to xxxx's home directory.

lithos 06-20-2011 04:16 AM

Quote:

Originally Posted by ssrameez (Post 4390520)
~ - this refers to your home directory.
~xxxx -- refers to xxxx's home directory.

while ~xxxx is users xxxx home, but ~/xxx/ddd is current users subdirectory /xxx/ddd

so if you try: cd ~/xxx/ddd/
it will change to 'current user's home/xxx/ddd subdir ! (if exists)

Let's say that I'm in [@/var/tmp] and I put: "cd ~/torrent" it will change to my home/torrent dir (@~/torrent)

I hope this explains it.


All times are GMT -5. The time now is 09:39 PM.