LinuxQuestions.org
Review your favorite Linux distribution.
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 07-01-2010, 11:47 PM   #1
sharincharles
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
hanzerik
Member
 
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

Code:
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
subho.d
Member
 
Registered: Jun 2010
Location: INDIA
Distribution: All Linux & Unix
Posts: 86

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

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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
Code:
cd /home/anisha/Desktop/
you can always type
Code:
cd ~/Desktop/

Last edited by Aquarius_Girl; 07-02-2010 at 03:58 AM.
 
Old 07-02-2010, 04:11 AM   #5
Dinithion
Member
 
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
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

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
LinuxSelfHelp
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!
 
  


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
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 PM.

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
Open Source Consulting | Domain Registration