If you're willing to consider tools other than cut
:
pax> sed 's/^[^-]*-//' inputFile
tom
harry
disk-see
This command uses the stream editor sed
to remove the part of the line from the start up to the first -
character. I generally prefer sed
for tasks like these since it's more adaptable when doing things other than simple one-level-deep field manipulations.
Having said that, this is a fairly simple task so a slight modification to your cut
command will suffice. Simply use -f2-
(field 2 onwards) in place of -f2
(field two only):
pax> cut -d'-' -f2- inputFile
tom
harry
disk-see