linux - how to run/execute a file in the command line without the ./ -


let's file 'foo.sh' has permissions , want run file in current directory:

#> ./foo.sh  

what/where change in order execute file (any file permissions) typing name:

#>foo.sh 

the idea way (in current directory). in case ./file.sh valid way execute file, file.sh work too. not intended run file.sh globally.

if want execute file specific local user create ~/bin directory put file inside of , append path $path env. ':' separator check following link.

http://www.cyberciti.biz/faq/unix-linux-adding-path/

but if want access globally. place file in /usr/bin or /usr/local/bin , check these paths registered in $path then. add permissions. open new terminal try call file.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -