LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-21-2007, 08:06 PM   #1
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Rep: Reputation: 16
Run from root and from folder


Hi

1)I need some info why some prgs run straight from root and some others need to browse to the folder and then run?

2)How can i select where to install and from where to run?

I use the following commands:

./configure
make
make install


Thanks
 
Old 05-21-2007, 08:18 PM   #2
Okie
Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 977

Rep: Reputation: 36
if you compiled source code and it installed and you did not set any parameters to ./configure they most likely installed to /usr/local, you might be able run them from /usr/local...

usually people use the parameter --prefix=/usr when running ./configure so they go in to /usr and not /usr/local...

your learning something today...

next time run ./configure --help and you will get some information that will help you along when you compile source code...
 
Old 05-22-2007, 12:00 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Do not exactly understand question 1, but the following may help:

Your system is setup to look in certain directories when you enter a command. If the command is not in those directories, you have to specify the path in front of the command or navigate to the directory and run the command from there.
Where the system looks is defined by the variable $PATH. Below are two examples, one for a normal user and one for root.
Code:
wim@btd-techweb01:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/share/texmf/bin:.
wim@btd-techweb01:~$ ifconfig
-bash: ifconfig: command not found
wim@btd-techweb01:~$ /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.190  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8234287 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1436852 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:710886591 (677.9 Mb)  TX bytes:1034567591 (986.6 Mb)
          Interrupt:11 Base address:0xc000

eth0:1    Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.191  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xc000

eth0:2    Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.192  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xc000

eth0:3    Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.193  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xc000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:756 (756.0 b)  TX bytes:756 (756.0 b)

wim@btd-techweb01:~$
Please note the dot at the end of the PATH. This indicates the current dircetory and allows to directly run from a directory. On other systems, it is not there and you have to use ./myprogram to run myprogram.
Code:
root@btd-techweb01:~# echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/share/texmf/bin
root@btd-techweb01:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.190  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8234396 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1436964 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:710896857 (677.9 Mb)  TX bytes:1034578163 (986.6 Mb)
          Interrupt:11 Base address:0xc000

eth0:1    Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.191  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xc000

eth0:2    Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.192  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xc000

eth0:3    Link encap:Ethernet  HWaddr 00:07:E9:3C:D0:4C
          inet addr:172.31.212.193  Bcast:172.31.213.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xc000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:756 (756.0 b)  TX bytes:756 (756.0 b)

root@btd-techweb01:~#
Please note that the current directory is not used in the PATH of the root user. Reason is that a user might have a dangerous command with the same name as a 'normal' command (e.g. ls to delete files). If the root user issues that command while in the user's directory, he might delete the whole system.
 
Old 05-22-2007, 06:53 PM   #4
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
I will read more about linux basics.

Thank you.
 
  


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
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 09:15 PM
Root folder J@kk%h1t Linux - Newbie 5 03-09-2007 06:01 PM
how to run everything in a folder twlilq Linux - Newbie 3 07-13-2006 10:42 PM
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 06:23 PM
how to run a script on subfolder file in a folder saggi_sam Linux - Newbie 5 07-13-2005 06:04 AM


All times are GMT -5. The time now is 03:44 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration