Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do,

find . -type f -name '*.c'

to find the list of .c files in my project. I want to open them all in the vim. I did something like this.

find . -type f -name '*.c' | xargs -- vim

It was not ideal. Is this correct or is there a better way. Please do not ask me to install a vim plugin. I am looking for unix way of doing things, i.e, by piping

share|improve this question
up vote 2 down vote accepted
vim $(find . -type f -name '*.c')

should work, at least if none of your .c files have special characters in their names.  Depending on what shell you're using (bash, csh, etc...), you might need to change that to

vim `find . -type f -name '*.c'`
share|improve this answer
    
Thanks for the response. The first way was definitely better. – Senthil Kumaran Sep 18 '13 at 6:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .