Ubuntu – How to retrieve only the needed line from terminal output

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