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

后端 未结 10 1165
梦谈多话
梦谈多话 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

    Type echo $PATH in a shell. Those are the directories searched when you type command, so put it in one of those.

    Edit: Apparently don't use /usr/bin, use /usr/local/bin

提交回复
热议问题