Linux: Dump contents of all files matching certain filename

I had to look for a specific line of code across multiple branches of a project. There were over 30 or so branches, so it'd be terribly time consuming to look through them all one by one.

Instead of doing that, write up a little snippet that'll dump all the contents of those files into vim.

find -name "" -exec echo '-----' {} '-----' \; -exec cat {} \; | vim -

This will search any folder under the current working directory for "" and dump its contents into vim.

The contents of the files are seperated by "----- path/to/ -----" for easy searching.

[ Source ]

Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog