#!/bin/sh # This will "cd to" the directory a file is in # Usage: # cdt cdt() { cd "$(dirname "$(realpath "$1")")" }