Answers for "shell get all lines that are in one file and not another"

1

bash return lines from one file that arent in another

# Example usage:
awk 'NR==FNR { b[$0] = 1; next } !b[$0]' input_file_1 input_file_2
# This returns all lines of input_file_2 that aren't found in 
# input_file_1

# Note, remove the ! to return all lines in common between the files
Posted by: Guest on October-01-2020
0

shell get all lines that are in one file and not another

diff file2 file1 | grep '^>' | sed 's/^>\ //'
Posted by: Guest on October-10-2021

Code answers related to "shell get all lines that are in one file and not another"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language