Skip to main content
added 311 characters in body
Source Link

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$ runNinja

If you deliberately wanted to be in that directory when running this ( Ex:if you are processing any file as input/output from that directory or dependency) , you have to write a function like below in your ~/.bashrc file or profile:

runNinja() { cd /home/user/Project/sub1/sub2/sub3 && ./ninja "$@" }

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$ runNinja

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$ runNinja

If you deliberately wanted to be in that directory when running this ( Ex:if you are processing any file as input/output from that directory or dependency) , you have to write a function like below in your ~/.bashrc file or profile:

runNinja() { cd /home/user/Project/sub1/sub2/sub3 && ./ninja "$@" }
added 2 characters in body
Source Link

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ninja$ ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$runNinja$ runNinja

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$runNinja

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$ runNinja
Source Link

Just append the path in the $PATH Variable in .bashrc like below:

export PATH=$PATH:/home/user/Project/sub1/sub2/sub3

And execute it from wherever you want in even without ./

$ninja

But ofcourse you can set alias also

alias runNinja='/home/user/Project/sub1/sub2/sub3/ninja'

And execute from wherever:

$runNinja