Skip to content

Instantly share code, notes, and snippets.

@jarun
Created May 23, 2016 06:13
Show Gist options
  • Save jarun/56a2292aec585d083ae358951c7e9b9d to your computer and use it in GitHub Desktop.
Save jarun/56a2292aec585d083ae358951c7e9b9d to your computer and use it in GitHub Desktop.
Add the same text at the beginning of multiple lines

vim

  • Press Ctrl-v to select the first column of text in the lines you want to change (visual mode).
  • Press Shift-i and type the text you want to insert.
  • Hit Esc, wait 1 second and the inserted text will appear on every line.

sed

$ sed -i 's/^/buku -u /' filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment