How to strip all numbers out of a text stream This is how to remove all text from the output of a file and only keep the other formatting. [email protected] ~/Desktop/b $ fortune -l | sed s/[a-z]/\ /gi; : 3:15 . . – .   , ! — ’[email protected] ~/Desktop/b $ fortune -l | sed …

Search and replace on the bash shell is very useful for various one-liner shell commands. The below example shows how to replace a # character with a * character. [email protected]:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h>   int main() { printf(".");   return 0; }[email protected]:/mnt/c/Users/johnc/Documents$ cat ip.c | sed ‘s/#/*/gi;’ *include <stdio.h> int main() …

This example uses sed to replace the beginning word of a sentence. [email protected] ~ $ echo "this is a line of text." | sed "s/this/This/gi;" This is a line of [email protected] ~ $ echo "this is a line of text." | sed "s/this/This/gi;" This is a line of text. This is a better way to …

The sed command is very useful for searching and replacing text in a file. This is how to search for and replace a text string in a file. [email protected] ~ $ sed -i ‘s/<main>/<mein>/gi;’ my.c This is how to search and replace text in a file and leave a backup copy with a tilde character …

Using wildcards on the Linux command line This is a standard listing of files with wildcards in the bash shell. [email protected] ~/Documents $ ls *.wad basenew.wad cc4-tex.wad city-heat.wad dark.wad doom.wad plutonia.wad scythe2.wad SKYTEST.wad brick.wad cchest4.wad consoleCopy.wad doom2.wad hexen.wad RIII.wad scythex.wad [email protected] ~/Documents $ ls *.wad basenew.wad cc4-tex.wad city-heat.wad dark.wad doom.wad plutonia.wad scythe2.wad SKYTEST.wad brick.wad cchest4.wad …