Ubuntu howto – add custom bash scripts to your path

  1. Create your bash script:
    mkdir ~/bin/
    gedit ~/bin/myscript
    chmod +x ~/bin/myscript
  2. Update PATH:
    To do so, open a terminal and edit your ~/.bashrc (if there’s no .bashrc file just create a new one):

    gedit ~/.bashrc

    Append the following two lines:

    PATH=$PATH:~/bin
    export PATH
  3. Logout and login.
    Now you should be able to run “myscript” just like the other commands

Leave a Comment