Help required using cut command

Hi all,
I have one text as '/home/psv/file/test.ksh'. In that I want to cut the text as '/home/psv/file/' .

Let me know which command to use.

Thanks
Mahalakshmi.A

man dirname

Hi All,
You can try like:

echo "/home/psv/file/test.ksh" | cut -b 01-15

$ dirname "/home/psv/file/test"
/home/psv/file

$ basename "/home/psv/file/test"
test

dirname or substring removal operator ${%}

str="/home/psv/file/test.ksh"

echo `dirname $str`/
echo "${str%/*}/"