LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2011, 03:51 AM   #1
xombboxer
Member
 
Registered: Apr 2011
Posts: 63

Rep: Reputation: 0
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?
 
Old 06-20-2011, 03:55 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Code:
# echo ~
/home/dave
your home directory
 
Old 06-20-2011, 04:19 AM   #3
ssrameez
Member
 
Registered: Oct 2006
Location: bangalore
Distribution: Fedora, Ubuntu, Debian, Redhat
Posts: 82

Rep: Reputation: 6
~ - this refers to your home directory.
~xxxx -- refers to xxxx's home directory.
 
Old 06-20-2011, 05:16 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by ssrameez View Post
~ - 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.

Last edited by lithos; 06-20-2011 at 05:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to the Current Terminal in a Bash Script? Daedagnir Programming 4 12-24-2010 11:36 AM
Identifying - sorting referring IP/Domain in access_log mlapl1 Linux - Newbie 2 08-07-2009 06:47 AM
Referring to current file/path in vim's :!<cmd> jrdioko Linux - Software 1 01-27-2006 05:03 PM
Question about referring a word in a command output aaronshi *BSD 2 05-14-2005 11:47 PM
is there a way not to type LD_LIBRARY_PATH referring to the *.so everytime you log on captainstorm Programming 4 07-01-2003 02:47 AM


All times are GMT -5. The time now is 11:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration