Home Linux Utils
cut on delimiter /  and print 1 st field.

echo "test1/test2/test3" | cut -d '/' -f 1  


cut on delimiter  /  and print fields 1 to 2

echo "test1/test2/test3" | cut -d '/' -f 1-2


cut on delimiter /  and print fields 1 and 3

echo "test1/test2/test3" | cut -d '/' -f 1,3