Skip to content

Instantly share code, notes, and snippets.

@vre2h
Last active March 29, 2019 07:55
Show Gist options
  • Save vre2h/858d267e7e51f0da4a341558b8039c76 to your computer and use it in GitHub Desktop.
Save vre2h/858d267e7e51f0da4a341558b8039c76 to your computer and use it in GitHub Desktop.
How to add bash aliases and functions.
  • You need to open ~/.bashrc file

    vim ~/.bashrc
    
  • Aliases and Functions

    • Then if you want to add alias see example:
      alias ls='ls - a'
      
    • If you want to add bash function see example:
      killport()
      {
        lsof $(lsof -t -i:$1)
      }
      
  • Apply ~/.bashrc file

    source ~/.bashrc
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment