I need to print text between two text fragments. I've found such example, that does exactly what I want, but I don't understand how it's done. Googling is difficult because command does not contain letters)
sed -n '/hostname/,/$/p' /tmp/ambari-agent.ini
hostname=localhost
As I understand, here I print text between hostname
and line end. p
option prints pattern to output. But why do I have three groups here and what does coma mean here?