I usually use like this
$ find -name testname.c
./dir1/dir2/testname.c
$ vi ./dir1/dir2/testname.c
it’s to annoying to type file name with location again.
how can I do this with only one step?
I’ve tried
$ find -name testname.c | xargs vi
but I failed.
Use the
-execparameter tofind.If your
findreturns multiple matches though, the files will be opened sequentially. That is, when you close one, it will open the next. You won’t get them all queued up in buffers.To get them all open in buffers, use:
Is this really vi, by the way, and not Vim, to which vi is often aliased nowadays?