≡ Menu

gnu sed

Linux / Unix: Sed Delete Matching Words In A File

I have a file called rsnapshot.conf. It has the words "ssh_args=-p 1222". How do I match and remove (delete) the words "ssh_args=-p 1222" from config file using sed command under Linux or Unix like operating systems?
[click to continue…]

sed: Remove All Digits / Input From Input

Q. How do I remove all digits or number from my text file or input using sed command?
[click to continue…]

Bash Shell: Replace a String With Another String In All Files Using sed and Perl -pie Options

How do I replace a string with another string in all files? For example, ~/foo directory has 100s of text file and I'd like to find out xyz string and replace with abc. I'd like to use sed or any other tool to replace all occurrence of the word.
[click to continue…]

Sed Delete Last Character

How do I delete a last character from input line under UNIX / Linux using sed tool? My sample scientific input data line is as follows and I'd like to get rid of last + character only:


How do I used sed to delete last + character?
[click to continue…]

Bash Script Replace Empty Spaces String

How do I remove all spaces from string using shell scripts? I've var="This is a test", and I'd like to remove all spaces.
[click to continue…]