How to cut the last field from a shell string April 12, 2024 by Tarik For what it’s worth, a cut-based solution: NEW_LINE="`echo "$LINE" | rev | cut -d/ -f2- | rev`/"