Learn something new every day
Search This Blog
Wednesday, February 9, 2011
Solution: merge two files / append two files in Linux
cat file1 file2 .. fileN > mergedfile
Note the '>' in the command: it points that the target file follows, don't forget to put it there.
If you accept that entries in the resulting file are sorted, you can use
to remove duplicates.
cat file1 file2 | sort | uniq > mergedfile
Share to Twitter
Share to Facebook
Share to Pinterest
Post a Comment
Post Comments (Atom)