5
stisch
6y

Is there a better CLI tool for finding/replacing stuff in files recursively? Other than like..

sed -i '' '/some/nonsense/g'

Comments
  • 0
    why?
  • 0
    If you're looking for something as nice and easy as the "Find/Replace in all files" features in most IDEs, nothing like it exists as far as I can tell.
    find . -exec sed -i 's/foo/bar/g' {} + is about as good as it gets
  • 1
    @franga2000 yeah that's similar to what I mean... or like, looping and running xargs. I recently discovered ripgrep, fzf, and httpie which are amazing replacements for the hard ways I had done such things.

    So I was thinking, "what other mundane headaches could I replace?"
  • 0
    @stisch me too, along with gcp instead of cp, exa instead of ls and grc for making many old commands nice and colorful.
  • 0
    @illusion466 sed is a GNU tool, so he's either using Linux or cygwin on Windows. Probably Linux.
  • 1
    I've got a simple bash script for this using grep and sed. When I get back to my laptop I'll ping you on here
  • 0
    If the sed is too complicated to type every time you could probably wrap it / soemthing similar in a shell script
Add Comment