Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to replace the specific numbers and use this command:

sed -e 's/[0-9]\{12\}/ /g' file.log

but nothing happens. As U can see this expression should replace all numeric occurrences with size of 12 digits, globally and replace it with space. I found out that the {, } symbols should be escaped - weird. It doesn't work. Please help.

share|improve this question

migrated from Mar 5 '13 at 9:09

This question came from our site for professional and enthusiast programmers.

Works for me. Can you show a sample input? – choroba Mar 5 '13 at 8:23
It works fine for me. Which Linux version are you using? – mvp Mar 5 '13 at 8:23
when I type echo 1224512561234 | sed -e 's/[0-9]\{12\}/ /g' i got response ` 4`. It seem to me to be correct. – V-X Mar 5 '13 at 8:23
As others have pointed out it appears to work fine.. That won't edit the content of the file itself though. If that's what you're trying to do you can try the -i option for sed see man sed ( – rvalvik Mar 5 '13 at 8:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.