How do I install a script to run anywhere from the command line?

后端 未结 10 1132
梦谈多话
梦谈多话 2020-12-04 10:14

If I have a basic Python script, with it\'s hashbang and what-not in place, so that from the terminal on Linux I can run

/path/to/file/MyScript [args]
         


        
10条回答
  •  旧巷少年郎
    2020-12-04 10:34

    The best place to put things like this is /usr/local/bin.

    This is the normal place to put custom installed binaries, and should be early in your PATH.

    Simply copy the script there (probably using sudo), and it should work for any user.

提交回复
热议问题