0

I got to know commands like ls -la | vim - can be used to open Linux command output in vim.

  1. What does - mean after vim?
  2. Is it some kind of special switch?
  3. Why doesn't simply using ls -la | vim works ?
2

from help -- :

Start editing a new buffer, which is filled with text that is read from stdin.

ls | vim doesn't work, because vim reads it's commands from the terminal (as opposed to the content of a buffer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.