+ 2
How can I execute a file using ./ if the file is located outside of my pwd??
Suppose there is an application with this path /opt/app/bin/app. Now if I go to this path and execute it using ./app it works fine but when I try to execute it from my home directory by using . /opt/app/bin/app it throws me an error saying "cannot execute binary file" Is this the correct way to traverse?
6 ответов
+ 5
The leading dot in your command means "relative to the current directory". Remove it and it'll refer to the file in the correct directory
+ 1
🇮🇳Vivek🇮🇳 I'm trying to set an alias to execute the application from any directory.
+ 1
I want to traverse to the home directory but without using cd and I want to use the path of the application .i.e /opt/app/bin/app with . or ./
+ 1
Thanks! Thomas
+ 1
You're welcome
0
But /opt is always in root directory.
Why you are trying from home directory?