- 2 months ago 15
Linux Question

Launch Bash script with command line and full path

I launch bash scripts normally with the ./ command.

But if I try to launch the script with the full path I get an error

No such file or directory

I am so confused, I made a search to be sure to get the right path.

$ pwd

$ ls

$ sudo chmod 777 start_scan

$ sudo find / -xdev -name start_scan

$ ./home/pi/server/start_scan
-bash: ./home/pi/server/start_scan: No such file or directory

Do you have any idea what could the problem be? I am using a macbook to use SSH and connect to a Rapsberry Pi under Raspbian and execute the script there.


./ is no command, but a path that means the current working directory.

Your line is almost correct, just remove the dot at the beginning:


When you type any path starting with a dot, the shell expands it to the current working directory, effectively searching in


which is obviously wrong.