LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shortcuts to bin files? (https://www.linuxquestions.org/questions/linux-newbie-8/shortcuts-to-bin-files-373511/)

Anthraxnz 10-16-2005 12:27 AM

shortcuts to bin files?
 
dunno how to word this but.
not entirly sure what im talking about either :S

but heres what i got

i got some bin files in root/home/folder
is it possible to link a command to run that bin file?

like how ifconfig is located in /sbin and you can type ifconfig from anywhere and it runs the ifconfig exe

hope that makes some sense.

so if i were in /home/name/desktop for example and wanted to run eg.bin i would just type ie -fg.

jrdioko 10-16-2005 12:39 AM

Those are executables (extensions like .bin don't matter in Linux, by the way) in your PATH that can be run just by typing their name. To see your current PATH (and maybe move some things there), type "echo $PATH"

If you want to add something to your PATH, add a line like the following to your ~/.bashrc file:

export PATH=$PATH:/new/folder/here

Anthraxnz 10-16-2005 12:50 AM

sorry dont follow :(

heres what i have

i have the file "ncftpget.bin" located in "root/home/ncftp/bin"

and want to be able to run it from anywhere on my system.

i typed echo $PATH and it printed this out

"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin"

didnt understand what this does
export PATH=$PATH:/new/folder/here

sorry totally noob to linux

jrdioko 10-16-2005 12:56 AM

Well, the short answer is to type "pico ~/.bashrc" or "nano ~/.bashrc" to edit your configuration file for bash (the shell) and add the line:

Code:

export PATH=$PATH:/root/home/ncftp/bin
Then if you open a new shell and type "echo $PATH" you should see that the new folder is in the list, meaning you can just type "ncftpget.bin" anywhere and it will run.

The longer answer is that there's probably a better way to do things. First, I hope this is a system administration kind of tool and that you're not running all the time as root, since that's very dangerous.

Second, the directory /root is root's home directory, just as /home/username is the home directory for normal users, so I'm not sure why there's a /root/home directory.

Third, you usually don't install programs in your home directory. It's pretty common to put them somewhere in /usr/local. I install from source, so I download files to /usr/local/src and extract/install them from there. That installs the files in the right places so they're already in my PATH and can be run just by typing the filename. If you look in the documentation for the program, it might give you some more information on the recommended way to install it.

Anthraxnz 10-16-2005 12:59 AM

i didnt come with any documention

its from www.ncftp.com

jrdioko 10-16-2005 01:02 AM

Click on "Download" then "installation instructions"

Anthraxnz 10-16-2005 01:17 AM

thats a deception, doesnt matter anyway anymore i got it working :)
thanks for your help

about those instructions tho
your reading them up untill it says somthing about perl5 then it turns of that the instructions are for the server version not the client

jrdioko 10-16-2005 01:19 AM

Ah, ok. Glad you got it working.


All times are GMT -5. The time now is 04:09 PM.