Text Replace in Shell

Level 243 keystrokes

sed performs text substitution on files.

Shell code

# s/localhost/127.0.0.1/g replaces every localhost on each line (without g, only the first)
# -i writes the result back into config.ini (GNU sed; on macOS use sed -i '')
1sed -i 's/localhost/127.0.0.1/g' config.ini
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Shell code and how often they appear.

  • .× 4
  • /× 3
  • '× 2
  • -× 1

More Shell examples at level 2

← Shell typing practice