Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-01-2010, 11:47 PM   #1
LQ Newbie
Registered: Jul 2010
Posts: 3

Rep: Reputation: 0
Smile What is "~" and "/" ?

Hi, am new to Linux when i tried to execute commands in TERMINAL i found these "~" "/" at the end of the path (user@hostname~ | user@hostname/) what does it mean and what is ~ and / ? Thanx
Old 07-02-2010, 12:09 AM   #2
Registered: Jan 2002
Location: Cheyenne Wyoming
Distribution: Debian/Raspbian/Mint
Posts: 717

Rep: Reputation: 32
~ is called a tilde
/ is call a forward slash

When you only see a ~ after your prompt it usually means you are in your /home/<username> directory
When you see a ~/<directoryname> means you are in a sub-folder in your /home/<username> directory (ie: Hanzerik@Hanzerik:~/public_html$)

Another way you may see it is $HOME ie(cd $HOME/folderfoo) would move you into the folder called folderfoo located in your /home directory

hanzerik@Hanzerik-Server:~$ cd $HOME  <<--- Changes directories to /home/hanzerik
hanzerik@Hanzerik-Server:~$ cd /home/hanzerik/  <<--- Does the same thing as above but more to type if you don't use auto-completion (tab key)
hanzerik@Hanzerik-Server:~$ cd public_html/
hanzerik@Hanzerik-Server:~/public_html$    <<--- Notice the / after the ~ sign
ETA: The / right after your prompt, without the ~, means you are in the / (root location of your file structure).

Last edited by hanzerik; 07-02-2010 at 12:12 AM.
Old 07-02-2010, 01:29 AM   #3
Registered: Jun 2010
Location: INDIA
Distribution: All Linux & Unix
Posts: 86

Rep: Reputation: 19
~ for home dir of user
/ for root dir of system
Old 07-02-2010, 03:55 AM   #4
Senior Member
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
1. ~ at the end of a file name indicates that it is a backup file.

2. ~ in the prompt indicates you are in the home directory.

3. While changing paths, you can use ~
Therefore instead of typing
cd /home/anisha/Desktop/
you can always type
cd ~/Desktop/

Last edited by TheIndependentAquarius; 07-02-2010 at 03:58 AM.
Old 07-02-2010, 04:11 AM   #5
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
~ can also be used as homedir to any user. ~/ is your home folder, and ~<username> is <usernames>s home folder. Notice the absence of '/' after '~' when you represent the homefolder of a different user.
Old 07-02-2010, 06:57 AM   #6
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,813
Blog Entries: 27

Rep: Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111

Welcome to LQ!

Since other members have provided answers to the query, I add the following links to enhance or aid in your understanding;

Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Utimate Linux Newbie Guide
Getting Started with Linux
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Home Networking
Virtualiation- Top 10

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!


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
how can I "cat" or "grep" a file to ignore lines starting with "#" ??? callagga Linux - Newbie 7 08-16-2013 06:58 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:36 AM.

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