Editing Specific Lines

Learn how to edit specific lines in a file.

Asterisks in markdown

We can italicize words or phrases in Markdown documents by surrounding them with asterisks or underscores, depending on the Markdown processor we’re using. In the document we created in the previous lesson, we’re using asterisks for bold words.

Let’s try using a basic substitution to replace them:

$ sed -e 's/*/_/g' document.md

Run the complete code on the terminal below for practice.

cat << 'EOF' > document.md
This is *very* important text with *very* important words.

* These words are not important.
* Neither are these.

You can *always* tell very important text because it's in italics. 
EOF
sed -e 's/*/_/g' document.md 

Get hands-on with 1200+ tech skills courses.