LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-13-2004, 01:55 AM   #1
blazted
Member
 
Registered: Nov 2004
Distribution: Red Hat Version 9 / Attempting to use Gentoo
Posts: 48

Rep: Reputation: 15
Running Commands


First i am a noob. I am trying to digest Linux as much as possible.

I am experimenting it using short tutorials people have written.

I have a annoyance though. Many commands that I know are there will not run when I am logged in. I have to always do a whereis command to find the command and then type in the full path name to execute the command. How can I avoid this and just type in the commnad from any location to get it to run?

Also when you look at a file, how do you tell if it is a commnad or just a file from the GUI interface. I knwo you can check the file and see if it has x bit turned on. But how do you there are commands or not. As an example, after you install a program into a directory you get a huge list of files in that directory. how would you know which file is the executable to run the program?

Thanks
 
Old 11-13-2004, 02:55 AM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Quote:
Also when you look at a file, how do you tell if it is a commnad or just a file from the GUI interface.
most of yr executables are in /usr/bin,/usrlocal/bin,/sbin,/usr/sbin.

Most distr. have a special icon for apps.


Quote:
I have a annoyance though. Many commands that I know are there will not run when I am logged in. I have to always do a whereis command to find the command and then type in the full path name to execute the command
be more specific. an example will help
 
Old 11-13-2004, 09:34 AM   #3
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
First check your path with echo $PATH. Add directories to the path by editing .bashrc or .bash_profile in your home directory. Alternatively, create links from your programs to a directory already in your path, eg /usr/local/bin like this:

ln -s /my/directory/my_prog /usr/local/bin

You should now be able to run rhe progs by just entering their names.
 
Old 11-13-2004, 11:17 AM   #4
blazted
Member
 
Registered: Nov 2004
Distribution: Red Hat Version 9 / Attempting to use Gentoo
Posts: 48

Original Poster
Rep: Reputation: 15
As an Example when i type ifconfig it will say error command not found. So I do a whereis ifconfig. I then have to type /usr/sbin/ifconfig to get the command to run.

So in order to just be able to type the command without the full path name I have to edit the .bashrc file? What kind of entry would I have to do? I have tried using the sysm link with firefox and it works from command line now.

But how can I run the programs from a GUI? Right now the only way I can run Firefox is through the command line. I have no shortcut for it in my programs from my desktop so I have no idea on how to run programs excpet through the command line? How do I do this?

Thank You
 
Old 11-13-2004, 11:33 AM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
thats what i expected.

the sbin folders contain commands that are supposed to be used only by root and are added only to roots path.

if you are a user use
su - (not just su)
to get a root prompt,
and u will have sbin in your path.

You may also use Alt+Ctrl+F1 and then login us root .u will probably have those commands in your path. (switch back to X-windows with Alt+Ctrl+F7)

type :
echo $PATH
or
env | grep PATH
to see what directories are in your path (as normal user and as root to see the difference)
 
Old 11-13-2004, 11:38 AM   #6
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Quote:
But how can I run the programs from a GUI? Right now the only way I can run Firefox is through the command line. I have no shortcut for it in my programs from my desktop so I have no idea on how to run programs excpet through the command line? How do I do this?
in gnome, right click -> create launcher

pick a name, a generic name and in the command field type firefox. pick an icon if you like.

I don't use KDE but i think u can do that by right clicking new->application or something like that.
 
Old 11-13-2004, 04:49 PM   #7
blazted
Member
 
Registered: Nov 2004
Distribution: Red Hat Version 9 / Attempting to use Gentoo
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks you. That solution worked for me to place icon on my desktop. I am using Gnome.
but whe
But it is not working when I am trying to put the command in my Internet Appilcations Menu. I add the item but when I try to save it it gives me an error. I would like to make custom folder with applications and scripts I might use to be accessible from the menus on the right hand pull up. I would like to create and customize m,y folders over there and then but my Applications in those folders instead of using the defaults.

I am using Red Hat 9.

Thanks for all the help Linux Community
 
  


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
Automatically running commands azebuski Linux - Newbie 3 02-11-2004 10:36 PM
running commands ./ ?? greendemon Linux - Newbie 4 08-04-2003 10:54 AM
Running commands linuxnewbie001 Linux - Newbie 6 08-01-2003 05:28 PM
Running commands on bootup robeb Linux - General 7 08-11-2002 09:02 PM
automatically running commands... lhoff Linux - General 9 02-21-2002 03:34 PM


All times are GMT -5. The time now is 03:41 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration