-1

file.txt has only one single line :

110 ./blabla/log.txt

I would like to delete all data after 110. I tried

sed -e 's/\.\/b.*$//g' ./file.txt

It didn't work, why ?

Thanks.

Lucas T
  • 9
  • 4

1 Answers1

0

There isn't a problem with the expression, but to do it inplace, you need:

sed -ie 's/\.\/b.*$//g' sed.txt

You could also simply by

sed -ie 's/ .*//g' sed.txt

However I suspect your example is actually not the real line in your file, perhaps you need to share this, there could be characters that your regex is missing.

ergonaut
  • 6,929
  • 1
  • 17
  • 47