EMBED YOUR TERMINAL RECORDINGS ONLINE

Sed, string toolbox for lazy people

DATE: 2011-11-20
AUTHOR: Coder of Salvation
AUTHOR WWW: http://leon.vankammen.eu
RELATED ARTICLE: http://en.wikipedia.org/wiki/Sed

Related recordings:

CAT COMMAND IN LINUX

tags: cat unix gnu linux view file textfile editing
LIST DIRECTORIES IN LINUX WITH LS

tags: ls directory show content linux disk beginner
SUTRAPHP-INTRODUCTION

tags: sutraphp sutra php console cli eventbased
MORE OVERVIEW IN MYSQL WITH SELECTS

tags: mysql, select, more overview, console
M4, THE HIDDEN GNU TREASURE

tags: m4, gnu, macroprocessor, template, search, replace, sed
THE UNIX TREE COMMAND

tags: unix console tree bash directory listing
DEVTODO: COMMANDLINE TODO MANAGEMEN

tags: todo xml tasks productivity management
VIM ALIGN

tags: vim align aligning text text editing text trick
VISUAL SELECTS IN VIM

tags: vim visual selects regex text editing fast
GENERATING PHP & SQL (MAPPING) CODE

tags: sutra generate sql generate database php cms mysql

Bookmark and Share
EMBED THIS RECORDING:
<div><script id="playterm-MjAxMS0xMS9zZWR0dHlyZWMtMTMyMTgyMTMyNXw4MHgyNA==" type="text/javascript" src="http://playterm.org/js/?hash=MjAxMS0xMS9zZWR0dHlyZWMtMTMyMTgyMTMyNXw4MHgyNA==" class="size:80x24"></script></div>
I recorded this `Sed, string toolbox for lazy people` shellsession because its great. Its a utility
that parses text and implements a programming language which can apply transformations to such
text.

EXAMPLES
========
sed "s/Lorem/Foobar/g"
sed "s/Lorem/Foobar/g;s/Foobar/ChangedFoobarintoLorem"
sed -i "s/foo/bar/g" somefile.txt

Damian said

more funky regex-stuff @
http://www.commandlinefu.com/commands/matching/sed-regex/c2VkIHJlZ2V4/sort-by-votes

coderofsalvation said

btw. when replacing urls, you will have to escape every '/' with a backslash. So '/' should be
written as '/'.
Hooooowever, sed has an facility to accept '|' delimiters as well. So for replacing urls, suggested
is:
cat foo.txt | sed 's|http://foo.com|http://bar.com|g'

 

Name   
Email (never shown)  
Comment