LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 09-06-2004, 12:46 PM   #1
Kilahchris
Member
 
Registered: Jan 2003
Location: NY
Distribution: Suse 9.0
Posts: 202

Rep: Reputation: 30
what does the $ stand for in linux ??


This might seem like a silly question , however i searched and cannot find an answer.
I noticed that the $ is used alot in bash shells and in settting environment variables

for example

LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH


or $HOME
 
Old 09-06-2004, 12:48 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
That is the variable.

So assuming:
$LD_LIBRARY_PATH=/usr/local/bin

Then running:
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH

Will make:
$LD_LIBRARY_PATH=/usr/lib:/usr/local/bin
 
Old 09-06-2004, 12:49 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,060

Rep: Reputation: 295Reputation: 295Reputation: 295
$ is just the standard bash variable expansion prefix (it's a bash-ism, not a Linux-ism). $FOO simply means "expand the variable named FOO". Perl also has variable prefixes ($ for scalars, @ for arrays and % for hashes).
 
Old 09-06-2004, 12:54 PM   #4
Kilahchris
Member
 
Registered: Jan 2003
Location: NY
Distribution: Suse 9.0
Posts: 202

Original Poster
Rep: Reputation: 30
ok

i also notice that the $home directory is not the other home directory like on my suse 9.0 $home is really ~/root and there is also a /home directory. why is ~/root called $home when there is another directory with that name.
 
Old 09-06-2004, 01:06 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
It is set to the user's home directory not to /home.
 
Old 09-06-2004, 01:40 PM   #6
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
"~/root" doesn't look right to me. "~" is equivalent to $HOME, so "~/root" would be /home/username/root.

If you are logged in as root, then $HOME is typically /root. If you're logged in as a user, $HOME is typically /home/username.
 
Old 09-06-2004, 01:59 PM   #7
Kilahchris
Member
 
Registered: Jan 2003
Location: NY
Distribution: Suse 9.0
Posts: 202

Original Poster
Rep: Reputation: 30
yes i am always logged in as root
its less of a hassle for me


linux:/home # cd $home
linux:~ #
linux:~ # pwd
/root


that what happens when i type $home it carries me to root. i just think its a coincedence there is another directory with the name home even though /root is really root a not home.

Last edited by Kilahchris; 09-06-2004 at 02:02 PM.
 
Old 09-06-2004, 02:07 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
But "/root" is your home directory!

/home is a directory for containing all of the other user's home directories.
 
Old 09-06-2004, 02:12 PM   #9
Kilahchris
Member
 
Registered: Jan 2003
Location: NY
Distribution: Suse 9.0
Posts: 202

Original Poster
Rep: Reputation: 30
ok now i finally get it ...


since root is the only user on my current linux setup, that was why the home folder was empty after installation. however the root folder had many folders and configuration data inside it ???
 
Old 09-06-2004, 03:54 PM   #10
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
Sorry to butt in here. Of course it's your own business, but every Linux guide/tutorial/document I've read has strongly discouraged running the system as root for everyday use. It's highly insecure and you could very easily bork your system that way, especially if you run a GUI. In the long run it's really worth your while to create a user account for general use and learn how to log in as root only when you need to do administrative functions. Once you have everything configured and learn how to administer it properly it's really not that much bigger of a hassle and it's actually quite reassuring to know you can't totally screw things up.

One of the big advantages of Linux over Windows is it's strict separation of user and administrative levels. It's a shame to throw that advantage away for the sake of a little convenience.
 
Old 09-06-2004, 07:48 PM   #11
Kilahchris
Member
 
Registered: Jan 2003
Location: NY
Distribution: Suse 9.0
Posts: 202

Original Poster
Rep: Reputation: 30
I setup my installation with only root because i am doing administrative things on it everyday ... it too much of a hassle to create another user and then switch back anytime i want install or make changes.

yes i know of the su command... to me that still is a hassle I know its not as secure , but I am the only user on this computer and it makes life a whole lot easier
 
Old 09-06-2004, 08:16 PM   #12
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
k...if typing 2 characters is too much of a hassle, then by all means open youself up. Dave was just trying to help.
Just want to add, though, that security is not the only argument for running as normal user. As root, there is no stopping total annihilation of your system with a few improper keystrokes....and no one is immune to typos.
 
Old 09-06-2004, 08:34 PM   #13
Tamsco
Member
 
Registered: Jul 2004
Location: 1st Brillouin Zone
Distribution: Gentoo (not ricer Gentoo)
Posts: 165

Rep: Reputation: 30
That's fine, it takes one kernel panic to change that mentality. Hope you backup your system
 
Old 09-06-2004, 10:08 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,964
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Quote:
Originally posted by Kilahchris
I setup my installation with only root because i am doing administrative things on it everyday ... it too much of a hassle to create another user and then switch back anytime i want install or make changes.

yes i know of the su command... to me that still is a hassle I know its not as secure , but I am the only user on this computer and it makes life a whole lot easier
In that case I urge you to disconnect your machine
from the Internet, otherwise you're no better than a
drunk driver who finds it too much of an inconvenience
to call a taxi or ask a sober friend to take him home.

I appreciate that you are the sole user, but
you're still potentially making your machine
available for a cracker or script-kiddie to run
a DDoS attack against others exploiting your
laziness....


Cheers,
Tink
 
Old 09-06-2004, 11:10 PM   #15
Kilahchris
Member
 
Registered: Jan 2003
Location: NY
Distribution: Suse 9.0
Posts: 202

Original Poster
Rep: Reputation: 30
Quote:
k...if typing 2 characters is too much of a hassle, then by all means open youself up. Dave was just trying to help.

I used to have several user names and when i typed su in the terminal i still didnt have full administrative rights as i would have it i was logged in as root
and i appreciate the help, and I thank Dave for his advice.... it kinda of annoying and repetitive to point out the same argument.




Quote:
I appreciate that you are the sole user, but
you're still potentially making your machine
available for a cracker or script-kiddie to run
a DDoS attack against others exploiting your
laziness....

Im aware of the script kiddie out there, However I am behind a strict and tough cisco firewall
and i have several up to date antivirus software on my computer. It is not laziness it is more i dont see the need to type su when it still doesnt grant me enough user rights at times to accomplish things im striving to do....



and on a final note... it is still possible to dork up your system as another user in such a way where if you log back in as root there is no way to fix it or even login as root.



Last edited by Kilahchris; 09-06-2004 at 11:19 PM.
 
  


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
what does etc stand for? aru_04 Linux - General 22 06-24-2012 09:00 AM
Choose Linux stand in internet Cafe, is it good idea? and why? Khmer Linux - General 2 08-26-2005 03:12 AM
CDMA Stand Alone Modem For Linux xyzxyz Linux - Wireless Networking 1 03-07-2005 01:19 AM
Stand By? driftingremains Linux - General 3 01-11-2004 11:46 AM
what does rc.d stand for? german Linux - General 4 11-13-2003 07:55 AM


All times are GMT -5. The time now is 02:18 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration