0

I need to save first 10 lines from manual for command man to txt file.

First step I have command man man but what to do next?

Thanks for help.

  • 3
    Isn’t this a homework question? Exactly 10 lines of man man look quite useless… – Melebius Oct 16 '18 at 13:25
6

Pipes and head will do what you need:

man man | head -10 > file.txt

head -n where n = number of lines you want

| improve this answer | |
  • 2
    Moreover 10 lines are default, so you can leave out the parameter -10 completely. – Melebius Oct 16 '18 at 13:24
  • 2
    Since @SteamerJ posted the right answer before, I'll delete my answer (because they are the same) and upvote his answer. – singrium Oct 16 '18 at 13:25
  • 1
    I'm glad that worked for you. Good to know about 10 lines being the default. @singrium, I saw that right after I posted, I had a message. Keep up the vigilant knowledge sharing! – SteamerJ Oct 16 '18 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.