Retrieve Specific Line from Terminal Output – Command Line Guide

command linetext processing

I want to get only let's say third line of df -h output.

What kind of command should I use?

Best Answer

This will output the 3rd line, regardless of content.

df -h | sed -n 3p