sed replace \ with \\ code example
Example 1: sed replace in file
sed -i 's/foo/bar/g' hello.txt
Example 2: replace using sed
#on my mac
sed -i -e 's/old-text/new-text/g' text.txt
Example 3: replace text with sed
sed -i 's/old-text/new-text/g' input.txt
Example 4: replace tab sed
sed -i.bak $'s/\t/ /' file.txt #replace tab with sed command