1

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?

1 Answer 1

2

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.