rg go up a directory code example Example: terminal find containing directory of file and cd to directory $ cd `find ~ -name filename.txt -exec dirname {} \;`