Результат:
$ sed 's/[0-9]\+$//' <in.txt
Есть:
example
example
example
Выполненная вами команда(sed 's/[0-9]\+$//' <in.txt >out.txt
)направит вывод в файл out.txt
Запуск cat out.txt
даст вам желаемые результаты.
Похоже, вы хотите что-то вроде
awk '{test[$5" "$1" "$2" "$3]++}END{for (t in test) print t}' file1 | cut -d' ' -f1 | sort | uniq -c
Пройти
test[$5" "$1" "$2" "$3]++ #populates an array with unique combinations of these fields
for (t in test) print t #print each unique array index (field combination) once to STDOUT
cut -d' ' -f1 #extract what was the original 5th field
sort #yes, yes OK @Bodo
uniq -c #count the number of times it appears
Выход
2 abc
1 def
Редактировать
Признавая поражение от рук @Bodo, решимость найти жизнеспособное awk
решение остается, поэтому я предлагаю этого уродливого зверя.....
awk '!test[$5" "$1" "$2" "$3]{out[$5]++;test[$5" "$1" "$2" "$3]++}
END
{for (o in out) print o, out[o]}' file1