Linux Unix Questions

User Generated

Cvtrba

Computer Science

Description

Will this command remove all of the blank lines from the output of the command?

sed '/^$/d' sedfile

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

yes it will but you may have space or tabs in your blank lines then you may try '/^\s*$/d


Anonymous
Just what I was looking for! Super helpful.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags