Wednesday, November 18, 2015

Edit a file directly using "sed" command in Linux


sed is stream editor, but can edit files directly

sed -i -e 's/foo/bar/g' hello.txt
 
s is used to replace the found expression "foo" with "bar" and g used to

replace any found matches.

-i option is used to edit in place on hello.txt.

-e option indicates a command to run.


No comments:

Post a Comment

Linux Kernel Compilation

 Step 1: Install Required Packages Install additional packages before building a kernel. To do so, run this command: sudo apt-get install gi...