Tilde In File Names: What Function?

L

Leif K-Brooks

(Pete Cresswell) said:
In file and directory names associated with web pages, I often see a tilde as
the first character.

I'm guessing this servs some useful function, but what?

e.g. http://www.armory.com/~images/

It serves the purpose of being a tilde; there's no special meaning
assigned by URI specifications. Many Web servers use it to refer to a
particular user's Web site, but again, that's not defined in any standard.

Jukka K. Korpela has an interesting article on why tildes shouldn't be
used in Web addresses; see <URL:http://www.cs.tut.fi/~jkorpela/tilde.html>.
 
R

Richard

(Pete Cresswell) said:
In file and directory names associated with web pages, I often see a
tilde as the first character.
I'm guessing this servs some useful function, but what?


One definition I read said, "There is a directory by this name somewhere,
find it.".
IMHO I believe it's used by people who do not understand how things work.
Or...it is understood fully and used in various ways.

I asked a host if I could set up a directory using the IP instead of my
domain name.
They said sure, just acess it as 127.000.000.001/~myfiles.

My news service, newsguy, allows users to setup pseudo websites and the
acess method is with newsguy.co/~membersite.

This may also help to denote a difference between /~images and /images where
the latter is a directory of the main website.
 
D

Dylan Parry

(Pete Cresswell) wrote:
[Tilde in URL]
I'm guessing this servs some useful function, but what?

Generally, if using Apache, then the tilde refers to a Website that is
located within the public_html directory for the user references after
the tilde, eg. http://mysite.com/~dylan would be for the user named
"dylan" and would have the files located in "/home/dylan/public_html" --
this way, large organisations such as Universities can have Websites
served for everyone with a login.

Of course, this is just /typical/ and might not be exactly the same with
all setups.
 
E

erikd

In file and directory names associated with web pages, I often see a tilde as
the first character.

I'm guessing this servs some useful function, but what?

e.g. http://www.armory.com/~images/

Tilde in unix speak refers to the home directory. So I'm guessing that
whenever you see the tilde in a URL, it's running the web server on a
unix box and the files are located under the users directory rather
than some other directory.
 
R

Richard

Tilde in unix speak refers to the home directory. So I'm guessing that
whenever you see the tilde in a URL, it's running the web server on a
unix box and the files are located under the users directory rather
than some other directory.

When I had asked my host of this, that's how they said to access the files.
domain.com/~files.
Problem is, I thought at first I could use any name I wanted, but got
roadblocked because "already in use" kept popping up. Why?
I finally figured out that it wasn't because it was only for me, but for
others who were also hosted on the same IP.
So it may be it is a public directory thing rather than a directory listing
within a particular domain.
 
S

Spartanicus

Toby Inkster said:
Furthermore tildes in file names by convention refer to backup copies.

e.g. http://www.example.org/robots.txt~ is a backup copy of
http://www.example.org/robots.txt

Surely that needs to be qualified to include the OSs it applies to,
afaik it applies to nix based OSs only.

Apache would probably more often be run on nix platforms, but it is
available for Win32 also, and since version 2 it allegedly runs reliable
on NT+ Win OSs.
 
L

Leif K-Brooks

Spartanicus said:
Surely that needs to be qualified to include the OSs it applies to,
afaik it applies to nix based OSs only.

It's just a convention, not an OS or Apache feature. I suppose it is
used more heavily in the Unix world, but e.g. the Windows version of Vim
does it too.
 
E

erikd

When I had asked my host of this, that's how they said to access the files.
domain.com/~files.
Problem is, I thought at first I could use any name I wanted, but got
roadblocked because "already in use" kept popping up. Why?
I finally figured out that it wasn't because it was only for me, but for
others who were also hosted on the same IP.
So it may be it is a public directory thing rather than a directory listing
within a particular domain.

Richard, Can you please change your quote character to just the single
character of "greater-than"? By using "space greater-than" as your
quoting character, my newsreader doesn't highlight the quoted text
properly.

My home directory at work is /home/erikd so if I want to copy a file
to my home directory I can use /home/erikd or just ~. Since tilde is
alias for the home directory structure, if I want to copy a file from
kevinj's home directory, I can use /home/kevinj/file or ~kevinj/file.
So rather than using ~ which needs interpretation, try finding out
what the full path is and use that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top