Skip to content

Instantly share code, notes, and snippets.

@Brantron
Last active August 29, 2018 17:31
Show Gist options
  • Select an option

  • Save Brantron/494a28d17b7d4b4e9f1ac8f3b400d34c to your computer and use it in GitHub Desktop.

Select an option

Save Brantron/494a28d17b7d4b4e9f1ac8f3b400d34c to your computer and use it in GitHub Desktop.

Revisions

  1. Brantron revised this gist Aug 29, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Kill Rails for Mac
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    Put this functionin your ~/.bash_profile

    function krails() {
    lsof -i tcp:3000 | awk -v N=2 '{print $N}' | tail -n -2 | xargs -L1 kill -9
    }
    }

    then from the terminal reload with `source ~/.bash_profile` and you can run `krails` anytime in the terminal to kill all rails processes
  2. Brantron created this gist Aug 29, 2018.
    3 changes: 3 additions & 0 deletions Kill Rails for Mac
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    function krails() {
    lsof -i tcp:3000 | awk -v N=2 '{print $N}' | tail -n -2 | xargs -L1 kill -9
    }