1) Cutting numerals from a string
sed 's/[^0-9]*//g'
For example:
Hello world my name is 1234abcd
Output : 1234
2) Extracting First number from a string
sed 's/[^0-9.]*\([0-9.]*\).*/\1/'
For example: Hello 123 world, my name is 1234abcd
output : 123
sed 's/[^0-9]*//g'
For example:
Hello world my name is 1234abcd
Output : 1234
2) Extracting First number from a string
sed 's/[^0-9.]*\([0-9.]*\).*/\1/'
For example: Hello 123 world, my name is 1234abcd
output : 123