Cheetsheet: sed

Remove any text but numbers: $ echo “123test456.ext” | sed -e s/[^0-9]//g 123456 To get all digits grouped: $ echo “123test456.ext” | egrep -o [0-9]+ 123 456 Remove zeros from the string begining: old=”0004937″# sed removes leading zeroes from stdinnew=$(echo