All Modules / Module 8 / Lesson 4 of 4

Running a whole workflow with one command

5 minute read

Make Scripts Available Everywhere

Right now you have to type the full path to run your script. To run it from anywhere, put it in a folder that's in your PATH.

Create a Scripts Folder

1

Create a folder for your scripts:

mkdir -p ~/bin
2

Add this line to your ~/.zshrc:

export PATH="$HOME/bin:$PATH"
3

Reload your config:

source ~/.zshrc
4

Move your script there:

mv ~/myinfo.sh ~/bin/myinfo

Now just type myinfo from anywhere and it runs.

Key Takeaway

Put scripts in ~/bin and add it to your PATH. Then run them like any command, from anywhere.