linux bash strings

http://www.tldp.org/LDP/abs/html/string-manipulation.html

also see sed and awk

see cut

the following will get the last two sections of /home/tech/Desktop/folder

$linked=/home/tech/Desktop/folder
echo $linked | rev | cut -d/ -f1-2 | rev

gives
Desktop/folder