Compare two files in Linux: ignoring first and last lines
comparison, diff, linux
Solution
Use GNU `tail` and `head`:
To ignore the first 10 lines of a file, use `tail` like this:
tail -n +11 file
To ignore the last 3 lines of a file, use `head` like this:
head -n -4 file
You can then construct your `diff` command using process substitution as follows:
diff <(tail -n +11 file | head -n -4) <(tail -n +11 file2 | head -n -4)
Problem
I´d like to compare two files, but I don´t want to take into account the first 10 lines, and the last 3 lines of both files. I tried to do it with diff and tail commands, like in here, but without success. how can I do it?