If I have a file path such as...
/home/smith/Desktop/Test /home/smith/Desktop/Test/
How do I change the string so it will be the parent dir
Depending on whether you need absolute paths you may want to take an extra step:
child='/home/smith/Desktop/Test/' parent=$(dirname "$child") abs_parent=$(realpath "$parent")