Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Thrash911

macrumors 6502
Original poster
Sep 14, 2006
297
4
Jutland, Denmark
I downloaded a new command to use in the terminal. I don't know where to put this.. Even if the command is at the same path the terminal is, it still can't find it. :confused:

Where do I put it? And will the os need to "register" the command or something?
 

isx

macrumors member
Sep 24, 2008
36
0
use terminal to navigate (cd) to the folder containing the app. Then type the app name and any other switches you need to use. Should work fine.


It's just a raw unix executable. It's "ipodpatcher" from here:

http://www.rockbox.org/twiki/bin/view/Main/IpodPatcher

I can double-click on it, and it executes in the terminal. But I have to use this command with some other parameters.. Is there a specific folder where I can put this, so the Terminal can always find it?
 

itickings

macrumors 6502a
Apr 14, 2007
947
185
use terminal to navigate (cd) to the folder containing the app. Then type the app name and any other switches you need to use. Should work fine.

Depending on the setup, you may have to prefix the command with its path to make the terminal look in the right place.

Code:
cd /path/to/application
./command [parameters]
or
Code:
/path/to/application/command [parameters]

Edit: Regarding the OP's question, the command can be put anywhere. It will still be accessible if the place you put it in has been added to the PATH which tells the Terminal where to look for commands. OS X: Change your PATH environment variable
 

purplelizzard

macrumors newbie
Feb 8, 2007
28
0
If you will use the command a lot, you can copy it to you /usr/bin/ or /usr/sbin/ folder. Then you can run it just by typing in 'ipodpatcher' regardless of what directory you are in. You can copy it like this:
Code:
cp /path/to/ipodpatcher /usr/bin/ipodpatcher
chmod 4755 /usr/bin/ipodpatcher
The first line copies your binary to the /usr/bin/ folder and the second one changes the permissions of the file you just copied so it can be executed. I can't remember if either of those commands requires root permissions, but if you get an error about permission being denied, just prefix each of those lines above with 'sudo' and type in an administrator password when prompted.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.