sed tutorial: sed replace
Sed replace, you can use the sed function: s, replace the text in the file. syntax: ➜ ~ sed 's/regexp/replacement/' file...
sed tutorial: sed insert line before match
Sed insert a line before match, you can use the sed function: i, add a new line before the matched string. syntax: sed '/option/i...
sed tutorial: sed add line after match
sed add line after match, you use sed function: a , to add a new line after the matched string. syntax: sed '/option/a newLine'...
How to find and replace specified string with sed in linux/unix
find and replace content in linux: Use the grep command and sed command to search and replace, Use the find command and sed command to...
How to remove lines with specific line number from text file with awk or sed in Linux/unix
Remove specific line numbers in linux/unix, use awk NR variable to delete a specific line numbers, use sed command action option "d" to delete a...
sed tutorial: sed append command
The sed append command can add a new line before or after the specified matching line. We do this by using sed a and i...
sed tutorial: sed address and address range(select lines) with examples
sed address and address range tutorial, by using addresses or address ranges, the sed command can apply certain actions to these address lines....
How to use sed to replace multiple patterns at once in linux/unix?
sed is a powerful streaming text editor, and replace pattern is one of the most used functions. This article introduces how to replace multiple patterns...
How to remove the first line of a text file using the linux command line?
remove the first line: use awk NR variable, awk '{if(NR>1){print $0}}' file ; use sed action option d, sed '1d' file; use tail n...
How to delete empty lines in a text file in linux/unix
To delete blank lines in a text file, you can use awk NF variable, awk regular expression, sed regular expression and grep -v '^$'...
How to delete lines containing a specific string in a text file in linux/unix
Delete lines containing a specific string in a text file, we have three implementation methods: sed -i '/ pattern/d', grep -v 'pattern' and awk '!/pattern/...
Sed command tutorial in linux/unix with examples and use cases
sed is a stream editor. 1. sed workflow
2. hold space and pattern space explain
3. sed syntax
4. sed debug tool
5. sed example
...
How to using multiple delimiters in awk and sed
Multiple delimiter-separated fields in awk or sed.
Using awk command:
➜ awk -F'[:=|]' '{print $1, $2, $3}' test.log;
Using sed command:
➜ sed 's/[:=|]/ /g' test.log...