Created
April 30, 2012 23:36
-
-
Save og-shawn-crigger/2563651 to your computer and use it in GitHub Desktop.
CLI Command to Find and Combine Text Files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./src -name '*.txt' -exec cat '{}' \; > test.txt | |
//The above looks through everything in the ./src directory (including all subdirectories) for any files with the .txt //extension. Each file it finds, it adds to test.txt. So at the end of the command's run, all of the text files will be //combined together into text.txt. You can use this strategy to easily combine lots of files into one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment