Answers for "bash check diff starting at specific line"

1

bash check diff starting at specific line

# Basic syntax:
diff <(head -n <file_1_last_row> <file_1> | tail -n <file_1_rows_b4_last>) <(head -n <file_2_last_row> file2 | tail -n <file_2_rows_b4_last>)
# Where:
#	- head and tail are used to select the rows of file_1 and file_2 that
#		are passed to the diff command (using <() )

# Example usage:
# To compare the 80th to 100th row of file_1 to to 100th to 120 row of file_2:
diff <(head -n 100 file_1 | tail -n 20) <(head -n 120 file_2 | tail -n 20)
Posted by: Guest on January-18-2022

Code answers related to "bash check diff starting at specific line"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language