Let's say you have
text="//ABC/REC/TLC/SC-prod/1f9/20/00000000957481f9-08d035805a5c94bf"
If you know the position, that is, in this case on the 9th, you can go with
echo "$text" | cut -d'/' -f9
However, if it is dynamic and you want to split by "/", it is safer to go with:
echo "${text##*/}"
This removes everything from the beginning to the last occurrence of "/" and should be the shortest to execute it.
See: Bash Reference Guide for more on this.
For more information, cutsee cut help page
source
share