Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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