cut on delimiter / and print 1 st field.echo "test1/test2/test3" | cut -d '/' -f 1 cut on delimiter / and print fields 1 to 2echo "test1/test2/test3" | cut -d '/' -f 1-2 cut on delimiter / and print fields 1 and 3echo "test1/test2/test3" | cut -d '/' -f 1,3