in reply to capturing terminal directory relative path?

sort your strings, and then compare them using index. Potentially split them into their parts:

/home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test /home/BORK/work/test-backfills/cp_test/82468 /home/BORK/work/test-backfills/cp_test/82480