user2419571
user2419571

Reputation: 139

Unix: Limiting the amount of lines of output from DIFF command

this is a rather low-level question but how do you limit diff's output to (for example) 5 lines.

I am running bourne shell and I know about diff -c and diff -c 5, but none of those commands are working for me. Is there another way to do that?

Upvotes: 1

Views: 1258

Answers (1)

hd1
hd1

Reputation: 34677

Which diff are you using, on NetBSD, I can limit it using the following:

% diff ~/.zshrc* | grep '[<>]' | head -5
< setopt autocd interactivecomments
< CASE_SENSITIVE="true"
< DISABLE_LS_COLORS="true"
< #plugins=(git)
> plugins=(git)

Hope that helps!

Upvotes: 2

Related Questions