bash, AWK, sips. A couple of bash commands I use daily:
cdf - change directory to the folder open in (Mac) Finder
cdf () {
currFolderPath=$( /usr/bin/osascript <<EOT
tell application "Finder"
try
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
end tell
EOT )
echo "cd to \"$currFolderPath\""
cd "$currFolderPath"
}
#dlm - "dlm filename" downloads filename.mp4 from URL in clipboard until its finished, resuming if interrupted
fname=$(pbpaste)
echo "Download $fname as $1.mp4 : "
until curl -C - -kLo $1.mp4 "$fname"
do
sleep 5
done
~/.bash_profile is the macOS equivalent of a .bashrc
It's also possible that the author is source-ing it (spelled that way intentionally :\) ) from another file in their .bash_profile
Note also that the author of the comment above was fast and loose with their description of dlm, and if you copypaste it as-written, it'll bomb. (Perhaps obvious, but you did ask where to put it!)
cdf - change directory to the folder open in (Mac) Finder