Linux Command Line Symbol ~/
Matthew Wedgwood
mwedgwood at gmail.com
Mon Oct 29 20:06:54 UTC 2012
"~" is a special character that gets interpreted by your shell (try "man
bash" then search for "Tilde Expansion"). Similar in concept to the *
character (which gets replaced with matching filenames), but ~ is only
meaningful at the beginning of a path. In bash, it usually gets replaced
with the value of the $HOME environment variable. I think other shells
treat it similarly.
The distinction is *mostly* academic until you try to do something like
"ssh someuser at somehost rm ~/.bash_history" and the ~ gets interpreted as
your *current* username, rather than the remote one.
-Matthew
On Mon, Oct 29, 2012 at 12:12 PM, Bill Sullivan <enkrates at gmail.com> wrote:
> Hi Dan,
>
> The tilde (~) is a shortcut to the current user's home directory. It's
> a hard thing to search for.
>
> I've always done well googling for command line stuff, but sometimes
> it really is hard, like here or with, say, documentation for the
> command "complete". :)
>
> Best,
> Bill Sullivan
>
> On Mon, Oct 29, 2012 at 12:01 PM, Dan Healy <dfhealy at gmail.com> wrote:
> > What does the "~/" mean? In my notes on connecting to an AWS instance I
> > have the following command line:
> >
> > scp -r -i your file.pem ../../../var/www/application folder name
> > ubuntu at IPAddr:~/
> >
> > The "~/" is pencilled in on my notes. I don't know why I put it there or
> > what it is supposed to do and I have not been able to find any
> explanation
> > on-line. I would appreciate any ideas any of you might have.
> >
> > Also, does anyone know of a good, searchable, on-line, Linux command line
> > reference?
> >
> > Thanks,
> >
> > Dan H
> >
> > --
> > Ubuntu-us-tx mailing list
> > Ubuntu-us-tx at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> > https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-tx
> >
>
> --
> Ubuntu-us-tx mailing list
> Ubuntu-us-tx at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-tx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-us-tx/attachments/20121029/07e22c44/attachment.html>
More information about the Ubuntu-us-tx
mailing list