1

My Ubuntu is dropping to an initramfs shell on boot. I'm trying to diagnose the problem but some of the commands are producing results that flow out the top of the screen.

I tried less but that's not available.

How can I read output that is more than 25 lines long?

2 Answers 2

1

I finally ended up piping the output to grep pattern -B 24 to show the 24 lines that came before the highest line I could read from the normal output. After reading these lines, you can repeat the command to get lines that come even earlier. A bit clumsy, but it works.

Oddly enough, tail is available in the initramfs shell, but head is not.

0

Thanks @timothy-smith, I will use the grep with -B <number>

$ grep <keyword> filename -B <line number>
$ man grep
...
     -B num, --before-context=num
         Print num lines of leading context before each match.  See also
         the -A and -C options.
...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .