Sounds like all you need is the plain old `diff` command, perhaps with the --GTYPE-group-format=GFMT option.
Get file one but not in file 2:
Code:
diff %< file file > output
Get file two but not file one:
Code:
diff %> file file > output
Get stuff common to both files:
Code:
diff %= file file > output
NOTE: I've never used this option, so it may not work exactly as I've written - try it and see.
There are other ways of getting only one file's different lines, still using diff. `diff` also has lots of options for formatting the output - read the man page for details, and experiment with it.
If you want to use `awk`, either write an awk script (a plain text file basically) using a shebang like
#!/usr/bin/awk -f or if you wish, just write a bash script (again, basically a text file) with a shebang like
#!/bin/bash and within the bash script, send data into `awk` either via a pipe, or by telling awk to read the file you want to operate on. Both methods (the scripts) can be executed from your console terminal.
P.S. - if `diff` alone is not producing precisely the output you want (like if it still has < or > symbols you don't want) then pipe the output through something like `sed` or `tr` to remove unwanted characters.
EDIT: Added info:
Code:
diff --left-column file1 file2 # show only file1 stuff
diff --left-column file2 file1 # show only file2 stuff