A program requires local path property to perform correctly. I'm seeking shortcut command to execute a program with a supplied localPath

For example,

cd /usr/local/blogrmis
/usr/local/blogrmis/remote & 

remote program requires local path @ /usr/local/blogrmis to run. is there any shortcut which i can do it in 1 line?


If the program must be run with the current working directory set to the directory containing the program you can combine both commands on one line:

 cd /usr/local/blogrmis; ./remote &

To shorten this you can create an alias (one-off, or permanently in your shell's .profile file)

 alias blogrmis="(cd /usr/local/blogrmis; ./remote &)" 

then you just type


Or create and use a shell-function (see man bash)

| improve this answer | |

Try this

cd /usr/local/blogrmis ; /usr/local/blogrmis/remote &

| improve this answer | |
  • Alternatively, there's && which will only run the second command once the first has shown to work. Although in this case you're suspecting the same folder tree to be present, but just saying so that the reader is aware of the difference... – Tamara Wijsman Jul 16 '12 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.