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
Just use echo $(cd ../ && pwd) while working in the directory whose parent dir you want to find out. This chain also has the added benefit of not having trailing slashes.
echo $(cd ../ && pwd)