# One Script, Several Files: source

A library is a file of functions that several scripts share: each script loads it with source, and finds it from any folder with here=$(dirname "${BASH_SOURCE\[0\]}"), the folder the script itself is saved in.

![Cheat sheet for the lesson One Script, Several Files: source: A library is a file of functions that several scripts share: each script loads it with source, and finds it from any folder with here=$(dirname "${BASH_SOURCE\[0\]}"), the folder the script itself is saved in.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/5ba0fb2194374b2ab665173959f8dd38.webp)

- Category: Bash
- Level: Journeyman
- Tags: &lt;source>, bash-source, dirname, library, linux, shell-function, unix
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-script-libraries-cheat-sheet
