3

I have the following line in a file:

      Linux Release............5.4.2.0-02 12_12_2011_07:31:23

How do I remove all characters before the first number with sed or awk?

I wish to get the following result:

      5.4.2.0-02 12_12_2011_07:31:23
pauska
  • 19,620
  • 5
  • 57
  • 75
Eytan
  • 611
  • 6
  • 13
  • 27

2 Answers2

2

Try this:

sed -e 's/[^0-9]\+//'
Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
1

One way using sed:

sed 's/^[^0-9]*//' <<<"      Linux Release............5.4.2.0-02 12_12_2011_07:31:23"

Result:

5.4.2.0-02 12_12_2011_07:31:23
Birei
  • 111
  • 2