Eytan Asked: 2012-01-11 03:06:33 +0800 CST2012-01-11 03:06:33 +0800 CST 2012-01-11 03:06:33 +0800 CST How do I use sed or awk to remove text? 772 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 linux shell awk sed 2 Answers Voted Best Answer Janne Pikkarainen 2012-01-11T03:13:24+08:002012-01-11T03:13:24+08:00 Try this: sed -e 's/[^0-9]\+//' Birei 2012-01-11T03:12:51+08:002012-01-11T03:12:51+08:00 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
Try this:
One way using
sed
:Result: