2

I have a python script: /usr/bin/doxypy.py

I have added #!/usr/local/bin/python as first line and given full permission to script with chmod 777 /usr/bin/doxypy.py.

If I want to run it as a linux command, let's say, I want to run it with only doxypy, is there any way to achieve this?

3 Answers3

2

Yes, rename it to /usr/bin/doxypy

Eric Duminil
  • 52,989
  • 9
  • 71
  • 124
1

Rename the file to doxpy and put it in a folder of $PATH, e.g. /usr/bin

AlexN
  • 1,613
  • 8
  • 21
1

remove the .py in the name and add this in the first line of the file

#!/usr/bin/env python

then give the run permission with

sudo chmod +x /usr/bin/doxypy

Its not a good practice, give all permissions to a file because any user can edit it, so just add the execution access right

efirvida
  • 4,592
  • 3
  • 42
  • 68