TODAY I LEARNED

Editing a file using cat

If you have to modify a file because any editor is present (vi, vim, nano, etc). you can use cat to do it:

$ cat > filename.ext
write or paste the content

ctrl+d

And that would be it! Super helpful when debugging flaky tests that only fail in the CI server

Tweet

Learned by Edwin Cruz on Feb 24, 2021

Discover our latest blog posts
  • #command-line
  • view raw
  • permalink
  • 2 likes
previous TIL next TIL
  • Log in
  • ?

    TIL is an open-source project by MagmaLabs that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any MagmaLaber as well as selected friends of MagmaLabs. We hope you enjoy learning along with us.

    • /wearemagmalabs
  • statistics
  • search
  • Twitter