What does ~ mean in a Linux shell?

I'm new to Linux and have been seeing this often. Could someone explain the concept here?

~/.somefilename

What does the ~ (tilde) signify?

3

3 Answers

The ~ (tilde) is a quick way of specifying your home directory.

The ~/.somefilename means your home directory, the file .somefilename.

1

The tilde ~ character is interpreted by most shells as the "home directory" for you. The "." doesn't mean anything if it's part of a filename, although some programs such as ls will (unless explicitely told otherwise) not show files if their name starts with a "dot". Sort of a "hidden" attribute.

Tilde originally shared the same space on the HOME key of certain keyboards and by association still means home directory.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like