How to run a .sh-script from any path in a terminal?

后端 未结 2 1984
小蘑菇
小蘑菇 2021-01-04 09:28

I know how to run the script I created. But it is a matter of pain that I need to change directory through terminal and run my scripts. I need to run the slowloris

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 09:45

    You have to copy or link the script into a directory that is on the $PATH. Usually /usr/bin and /usr/local/bin/ are on the path so these are good locations to link or copy the script to.

    ln -s /path/to/your/script /usr/local/bin
    

    If you are not root you will either need to sudo that command or run it as the root user.

提交回复
热议问题