title: Check if file is in a given directory (or sub-directory) in bash
body: <p>How can I check if a given file is in a directory, including any directories with that directory, and so on? I want to do a small sanity check in a bash script to check that the user isn't trying to alter a file outside the project directory.</p>