phranque

msg:4043391 | 12:30 pm on Dec 15, 2009 (gmt 0) |
you can use the unix cat command for this. here are some examples of usage: cat file1 file2 file3 >bigfile (concatenates a list of files into one file) cat *.txt >bigfile.txt (same but using wildcarding to list the files) cat file.txt >>existingfile.txt (concatenating a file to the end of an existing file)
|
wheel

msg:4043431 | 2:10 pm on Dec 15, 2009 (gmt 0) |
The stuff you can do from the command line in linux is crazy. The difficult part is knowing the commands :). Doing search and replace/text finding type of things are crazy easy. I'm no expert but I routinely use the two following: grep -R string * which looks recursively for 'string' in every file, down into the directory structure. Looking for a bit of code? just type that at the top of the directory and it'll find it for you. The other one I use is a search and replace: perl -p -i -e 's/stringa/stringb/g' * which replaces all occurrences of stringa with stringb. (I think this is called the perl 'pie' or something like that).
|
StupidScript

msg:4043774 | 11:54 pm on Dec 15, 2009 (gmt 0) |
wheel ... if you like the PERL, you ought'a love sed: sed -i 's/searchfor/replacewith/g' * Just sayin' ...
|
phranque

msg:4044025 | 11:37 am on Dec 16, 2009 (gmt 0) |
linux 101 day 1 includes these commands: man ls rm cat grep sed for a few of these commands with options open up another dimension: grep -i grep -v grep -l sed -n be very (VERY) careful with: rm -r always (ALWAYS) do this first: ls -r then learn these operators: ¦ (that would be the vertical bar which gets converted to a broken bar in this forum - uppercase backslash on a typical keyboard) > >> that might cover at least 80-90% of your daily needs if you also learn awk you can do some very sophisticated text processing without writing a program per se.
|
|