Cut the last 15 characters off

Hi Gurus,

I am trying to execute the below command. However the output shows the value + path of the folder where the command is being executed. But I am only interested in the value but not the path.

du -hs /aps/inf/SeLogs

when I execute the above command, output is

32G /aps/inf/SeLogs

Is there a way to cut only the 'path' portion of it.

Thanks in advance
Sam

du -hs /aps/inf/SeLogs | cut -f1
du -hs /aps/inf/SeLogs | awk '{print $2}'

tyler_durden

If the code never contains whitespace

a=$(du -hs /aps/inf/SeLogs); echo ${a#*' '}

If the code does contain whitespace you need to use

a=$(du -hs /aps/inf/SeLogs); echo ${a##*' '}

but the path cannot contain any whitespace.

Mike

Hey Gurus,

They all work. Thanks for quick turnaround.

-Sam

if only value is required ( as per the question ) it has to be $1.