How to run a program from within a different directory in the Linux command line

unix

How can I run a program without cd'ing to the directory where it resides?

I have tried ./my/dir myfile.pl and again without the leading . but neither work.

Best Answer

You enter the full path of the executable:

./path/to/my/dir/myfile.pl
Related Question