home
NOTE: Under Construction - I'm in the middle of upgrading my site and lots of stuff is kinda broken. Please forgive the mess.

Use 'type' To Figure Out Which File A bash Function Is In

I write a bunch of little functions for frequently used command line commands. For example, I have this for browser-sync in my dotfiles:

January 2024
Code
function bs () {

browser-sync . --port 3939 \
--watch --directory \
--no-notify --no-inject-changes

}

The problem is I can never remember I put those file.

Using which or whence doesn't show the file location. Just the function or its name.

type gets you to the file path though:

Code
type bs
Results
bs is a shell function from 
/Users/alan/.zsh_tools/bs.zsh
═══ § ═══

Footnotes And References