sed¶
Stream Editor for filtering and transforming text, really handy one-liners for SED
Create a cheatsheet for a command for mkdocs¶
rclone --help \
|sed 's/^ /rclone /g' \
|awk '{$3="-" OFS $2} 1' \
|sed 's/ - / \t# /g' \
|sed 's/#/\n###/g' \
|sed 's/$./\n/g' \
|sed "0~2a \`\`\`sh \\ " \
|sed 's/###/\`\`\`\n###/g'
Append line after match¶
Insert line before match¶
Insert '''sh above every line that begins with ### and insert ''' below every line that match¶
Add a blank line every 5 lines (after lines 5, 10, 15, 20, etc.)¶
Print first 10 lines of file (emulates behavior of "head")¶
Print first line of file (emulates "head -1")¶
print the last 10 lines of a file (emulates "tail")¶
Print the last 2 lines of a file (emulates "tail -2")¶
Print the last line of a file (emulates "tail -1")¶
Print only lines which match regular expression (emulates "grep")¶
### Delete all CONSECUTIVE blank lines from file except the first 2:
Delete all leading blank lines at top of file¶
Delete the last line of each paragraph¶
Remove most HTML tags (accommodates multiple-line tags)¶
Add one blank line between all of them with sed¶
Inserts one line every 3 rows.¶
Method 2: Inserts one line every 3 rows.¶
Method 3: Inserts one line after every string and at end, make 2 empty lines¶
Uppercasing First Letter of Words Using SED¶
Colorize a word¶
To print a specific line from a file¶
uncomment the lines where the word DEBUG is found¶
convert a line to a space¶
find which lines in a file are longer than N characters¶
Easy way to display yum repo priorities¶
sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n
Get your Speed Dial urls¶
sed -n '/url/s#^.*url=\(.*://.*\)#\1#p' ~/.mozilla/firefox/*.[dD]efault/SDBackups/*.speeddial | sort | uniq
Search and replace pipes for tabs in file with backup¶
Remove/replace newline characters.¶
Append the line # -- coding: utf-8 -- to a file¶
Append a new line "FOOBAR" in all files matching the glob*¶
Simply clean playlist¶
delete all leading whitespace from each line in file¶
Sed file spacing¶
Convert an UNIX file to a DOS file.¶
truncate files without output redirection or temporary file creation¶
sed : using colons as separators instead of forward slashes¶
delete a particular line by line number in file¶
Convert windows text file to linux text document¶
Reverse DNS lookups¶
sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).in-addr.arpa domain name pointer\(.*\)\./\4.\3.\2.\1\5/' \ lookups.txt
a find and replace within text-based files¶
Remove superfluous from conf file¶
to display number of lines in a file without using wc command¶
Remove all leading and trailing slashes on each line of a text file¶
Extract all urls from the last firefox sessionstore.js file used.¶
prints line numbers¶
Bold matching string without skipping others¶
Print line numbers¶
Print just line 4 from a textfile¶
Remove trailing whitespaces (or tabs) from a text file¶
Remove CR LF from a text file¶
turn url and link text into a hyperlink¶
Convert all tabs in a file to spaces, assuming the tab width is 2¶
convert Unix newlines to DOS newlines¶
Print all lines containing the word 'jan' to a new file.¶
put all lines in comment where de word DEBUG is found¶
Extract a bash function¶
Remove ( color / special / escape / ANSI ) codes, from text, with sed¶
List your largest installed packages (on Debian/Ubuntu)¶
sed -ne '/^Package: \(.*\)/{s//\1/;h;};/^Installed-Size: \(.*\)/{s//\1/;G;s/\n/ /;p;}' /var/lib/dpkg/status | sort -rn
Delete an hard disk entry in Virtualbox registry¶
count the number of times you match a substring in a larger text file¶
Get rid of multiple spaces/tabs in a text file¶
list all available disks and disk partitions¶
top 10 commands used¶
Display a block of text with AWK¶
Show a script or config file without comments¶
sed -e '/^[[:blank:]]*#/d; s/[[:blank:]][[:blank:]]*#.*//' -e '/^$/d' -e '/^\/\/.*/d' -e '/^\/\*/d;/^ \* /d;/^ \*\//d' /a/file/with/comments
Print file content in reverse order¶
Remove blank lines from a file and save output to new file¶
delete first X lines of a file¶
Get rid of multiple spaces/tabs in a text file¶
empty set of files¶
Remove a line from a file using sed (useful for updating known SSH server keys when they change)¶
run vlc as root¶
convert DOS newlines to unix newlines¶
Backup a file before editing it.¶
optimized sed¶
Remove "#' from configuration files.¶
Remove comments from files¶
Remove all HTML tags from a file¶
Update zone file Serial numbers¶
Remove a line in a text file. Useful to fix "ssh host key change" warnings¶
Remove a line from a file using sed (useful for updating known SSH server keys when they change)¶
See the 10 programs the most used¶
separate (emphasize) digital strings from other text¶
Print all lines between two line numbers¶
Insert a colon between every two digits¶
Regex to remove HTML-Tags from a file¶
regex for turning a URL into a real hyperlink (i.e. for posting somewhere that accepts basic html)¶
Shows cpu load in percent¶
Apply substitution only on the line following a marker¶
Remove color codes (special characters) with sed¶
Comment out a line in a file¶
Simplification of "sed 'your sed stuff here' file > file2 && mv file2 file"¶
Remove color codes (special characters) with sed¶
Prepend a text to a file.¶
Delete line number 10 from file¶
remove empty lines¶
Convert files from DOS line endings to UNIX line endings¶
remove leading blank lines¶
Remove color codes (special characters) with sed¶
Convert Unix newlines to DOS newlines¶
reverse order of file¶
Remove the first character of each line in a file¶
Delete Last Line of a File if it is Blank¶
Simple XML tag extract with sed¶
Perform sed substitution on all but the last line of input¶
remove empty lines in place with backup¶
Print all the lines between 10 and 20 of a file¶
Efficiently print a line deep in a huge log file¶
Extract title from HTML files¶
grep -v with multiple patterns.¶
a find and replace within text-based files, for batch text replacement, not using perl¶
Go to the Nth line of file¶
Add thousand separator with sed, in a file or within pipe¶
append empty line after every line in file.txt¶
Efficiently extract lines between markers¶
Change the homepage of Firefox¶
sed -i 's|\("browser.startup.homepage",\) "\(.*\)"|\1 "http://sliceoflinux.com"|' .mozilla/firefox/*.default/prefs.js
sed edit-in-place using -a option instead of -i option (no tmp file created)¶
sedi(){ case $# in [01]|[3-9])echo usage: sedi sed-cmds file ;;2)sed -a ''"$1"';H;$!d;g;' $2 |sed -a '/^$/d;w '"$2"'' ;;esac;}
Remove a range of lines from a file¶
Gives you what's between first string and second string included.¶
sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n"
Remove blank lines¶
Deleting / Ignoring lines from the top of a file¶
Extract ip addresses with sed¶
sed -n 's/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/\nip&\n/gp' ips.txt | grep ip | sed 's/ip//'| sort | uniq
remove lines which are longer than 255¶
grep -v with multiple patterns.¶
Remove leading zeros in multiple columns with sed¶
output the contents of a file removing any empty lines including lines which contain only spaces or tabs.¶
extract all urls from firefox sessionstore¶
sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txt
print contents of file from line 1 until we match regex¶
preprocess code to be posted in comments on this site¶
quick and dirty formatting for HTML code¶
Do a search-and-replace in a file after making a backup¶
Concatenates lines using sed¶
Replace multiple spaces with semicolon¶
Change every instance of OLD to NEW in file FILE¶
Convert DOS newlines (CR/LF) to Unix format¶
Embed next line on the end of current line using sed¶
remove newlines from specific lines in a file using sed¶
Capitalize the first letter of every word¶
Show a config file without comments¶
Top 20 commands in your bash history¶
sed -e 's/[;|][[:space:]]*/\n/g' .bash_history | cut delimiter=' ' fields=1 | sort | uniq count | sort numeric-sort reverse | head lines=20
Update grub menu.lst¶
sed -e '/^$/d' -e '/^#/d' -e '/initrd/ a\ ' -e 's/hiddenmenu//g' -e '/^timeout/d' -e '/default/ a\timeout\t\t15' -e 's/quiet//g' -e 's/splash/rootdelay=60/g' /boot/grub/menu.lst > /boot/grub/menu.lst.new
delete all leading and trailing whitespace from each line in file¶
Remove space and/or tab characters at the end of line¶
delete all trailing whitespace from each line in file¶
Display email addresses that have been sent to by a postfix server since the last mail log rollover¶
Given process ID print its environment variables¶
Print only the odd lines of a file (GNU sed)¶
Search replace with Ansible style timestamps¶
Exclude inserting a table from a sql import¶
Getting a domain from url, ex: very nice to get url from squid access.log¶
Multi line grep using sed and specifying open/close tags¶
SED - Substitute string in next line¶
remove repeated pairs of characters e.g. "xtxtxtxt" will become "xt"¶
Delete all empty/blank lines from text file & output to file¶
Fix subtitle timing (for .sub files)¶
sed -e 's/{/|/' -e 's/}{/|/' -e 's/}/|/' myFile.sub | awk -F "|" 'BEGIN {OFS = "|"} { $2 = $2 - 600; $3 = $3 - 600; print $0 }' | sed -e 's/^|/{/' -e 's/\([0-9]\)|\([0-9]\)/\1}{\2/' -e 's/|/}/' >
MySQL: Slice out a specific table from the output of mysqldump¶
Comment out all lines in a file beginning with string¶
commentate specified line of a file¶
Remove multiple spaces¶
Simple Comment an entire file¶
Convert a Python interactive session to a python script¶
Add a line from 1 file after every line of another (shuffle files together)¶
print contents of file from first match of regex to end of file¶
Compute the numeric sum of a file¶
Delete leading whitespace from the start of each line¶
Delete leading whitespace from the start of each line¶
Search apache virtual host by pattern¶
Terminal - Show directories in the PATH, one per line with sed and bash3.X `here string'¶
Remove a range of lines from a file¶
Every Nth line position # (SED)¶
sed -n '1,${p;n;n;}' foo > foo_every3_position1; sed -n '2,${p;n;n;}' foo > foo_every3_position2; sed -n '3,${p;n;n;}' foo > foo_every3_position3
In-Place search/replace with datestamped backup¶
Replace spaces in a file with hyphens¶
Delete the specified line¶
Change host name¶
Print just line 4 from a textfile¶
Print just line 4 from a textfile¶
Cleanup a (source) text file, removing trailing spaces/tabs and multiple consecutive blank lines¶
Put uppercase letters in curly brackets in a BibTeX database¶
Prepend a text to a file.¶
Edit Ruby files within the current directory to use Ruby 1.9+ style symbol keys instead of rockets¶
uncomment the lines where the word DEBUG is found¶
Raspberry Pi serial number w/o leading zeros¶
Remove color codes (special characters) with sed¶
urldecoding¶
Remove color codes (special characters) with sed¶
Replace words with sed¶
Rebuild a Delimited File with a Unique Delimiter¶
sed 's/$/uniqueString/' file.old | sed 's/,/\n/g' | sed ':loop;/^\"[^\"]*$/N;s/\n/,/;/[^\"]$/t loop' | sed ':loop;N;s/\n/@/g;/uniqueString$/!b loop;s/uniqueString$//' > file.new
delete all trailing whitespace from each line in file¶
delete all leading and trailing whitespace from each line in file¶
Remove \r (carriage return) in a file¶
delete all leading and trailing whitespace from each line in file¶
Puts every word from a file into a new line¶
Change your e-mail address in multiple files¶
Delete all lines after the first match¶
Extract ip addresses with sed¶
sed replace string in whole files in folder¶
bash chop¶
Printout a list of field numbers from a CSV file with headers as first line.¶
Remove lines that contain a specific pattern(\(1) from file(\)2).¶
Convert Windows/DOS Text Files to Unix¶
insert blank lines¶
Removes lines [range] from file¶
more than 4 repeated characters to a single character¶
Convert camelCase to underscores (camel_case)¶
Tells which group you DON'T belong to (opposite of command "groups") - uses sed¶
Remove blank lines from a file¶
Convert ISO8601 dates to milliseconds since epoch¶
sed "s|\(2[0-9]\{3\}-[01][0-9]-[0-3][0-9]T[01][0-9]:[0-5][0-9]:[0-5][0-9].[0-9]\{3\}Z\)|$(date -d \1 +%s)000|g"
Go to the Nth line of file¶
MySQL: Slice out a specific database (assumes existence of the USE statement) from mysqldump output¶
Remove color codes (special characters) with sed¶
Only change the first occurrence of the pattern¶
Remove the first line containing 'match' from file¶
replace deprecated php-function split in php files¶
File without comments or blank lines.¶
Comment out all lines in a file beginning with string¶
Remove color codes (special characters) with sed¶
Replace strings in files¶
pick up 3 lines start at every 5th line of file.txt¶
Regular expression search pattern to remove the Datetime and Name when you paste from skype chat into your text editor¶
Analyze Apache Web Log Statistics starting on DATE x¶
Duplicate a line in a text file and replace part of the duplicated line¶
Format a password file for John the Ripper from Cisco configs (Level 5)¶
sed -n 's/[ :]/_/g; s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' < cisco-device-config > passwd
HTML esacaping with sed¶
Parse bookmarks and download youtube files¶
Remove color codes (special characters) with sed¶
Extract specific lines from a text file using Stream Editor (sed)¶
Insert line(s) at top of file using sed¶
Extract XML from an otherwise plain text log file¶
List the CPU model name¶
Edit hosts file to remove "foo.novalocal" from it where foo is the hostname of a new VM¶
convert html links into plain text with link anchor¶
delete first and last line from file¶
Remove comments from files¶
Sort a one-per-line list of email address, weeding out duplicates¶
Create fortune's *.dat file from commandlinefu from saved preferite¶
Replace nelines with spaces¶
Revoke an existing user's group memberships and add another user to those same groups,¶
Uncomment line based on string match¶
to display all characters except second last character from each line of a file¶
Convert CSV files to TSV¶
Change time format in log, UNIX Timestamp to Human readable¶
Remove lines ending or trailing slash (/)¶
Remove last x lines from file using sed¶
Remove a range of lines from a file¶
rsnapshot vim edit replaying space tabs¶
Join lines split with backslash at the end¶
To print a specific line from a file¶
uncomment the lines where the word DEBUG is found¶
sed : using colons as separators instead of forward slashes¶
delete a particular line by line number in file¶
put all lines in comment where de word DEBUG is found¶
Extract a bash function¶
Remove ( color / special / escape / ANSI ) codes, from text, with sed¶
top 10 commands used¶
Display a block of text with AWK¶
Remove comments from files¶
Remove all HTML tags from a file¶
Update zone file Serial numbers¶
Remove a line in a text file. Useful to fix "ssh host key change" warnings¶
Remove a line from a file using sed (useful for updating known SSH server keys when they change)¶
See the 10 programs the most used¶
separate (emphasize) digital strings from other text¶
Print all lines between two line numbers¶
Insert a colon between every two digits¶
Regex to remove HTML-Tags from a file¶
regex for turning a URL into a real hyperlink (i.e. for posting somewhere that accepts basic html)¶
Shows cpu load in percent¶
Apply substitution only on the line following a marker¶
Remove color codes (special characters) with sed¶
Comment out a line in a file¶
Simplification of "sed 'your sed stuff here' file > file2 && mv file2 file"¶
Remove color codes (special characters) with sed¶
Prepend a text to a file.¶
Delete line number 10 from file¶
remove empty lines¶
Convert files from DOS line endings to UNIX line endings¶
remove leading blank lines¶
Remove color codes (special characters) with sed¶
Convert Unix newlines to DOS newlines¶
reverse order of file¶
Remove the first character of each line in a file¶
Delete Last Line of a File if it is Blank¶
Simple XML tag extract with sed¶
Perform sed substitution on all but the last line of input¶
remove empty lines in place with backup¶
Print all the lines between 10 and 20 of a file¶
Efficiently print a line deep in a huge log file¶
Extract title from HTML files¶
grep -v with multiple patterns.¶
a find and replace within text-based files, for batch text replacement, not using perl¶
Go to the Nth line of file¶
Add thousand separator with sed, in a file or within pipe¶
append empty line after every line in file.txt¶
Efficiently extract lines between markers¶
Change the homepage of Firefox¶
sed -i 's|\("browser.startup.homepage",\) "\(.*\)"|\1 "http://sliceoflinux.com"|' .mozilla/firefox/*.default/prefs.js
sed edit-in-place using -a option instead of -i option (no tmp file created)¶
sedi(){ case $# in [01]|[3-9])echo usage: sedi sed-cmds file ;;2)sed -a ''"$1"';H;$!d;g;' $2 |sed -a '/^$/d;w '"$2"'' ;;esac;}
Remove a range of lines from a file¶
Gives you what's between first string and second string included.¶
sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n"
Remove blank lines¶
Deleting / Ignoring lines from the top of a file¶
Extract ip addresses with sed¶
sed -n 's/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/\nip&\n/gp' ips.txt | grep ip | sed 's/ip//'| sort | uniq
remove lines which are longer than 255¶
grep -v with multiple patterns.¶
Remove leading zeros in multiple columns with sed¶
output the contents of a file removing any empty lines including lines which contain only spaces or tabs.¶
extract all urls from firefox sessionstore¶
sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txt
print contents of file from line 1 until we match regex¶
preprocess code to be posted in comments on this site¶
quick and dirty formatting for HTML code¶
Do a search-and-replace in a file after making a backup¶
Concatenates lines using sed¶
Replace multiple spaces with semicolon¶
Change every instance of OLD to NEW in file FILE¶
Convert DOS newlines (CR/LF) to Unix format¶
Embed next line on the end of current line using sed¶
remove newlines from specific lines in a file using sed¶
Capitalize the first letter of every word¶
Show a config file without comments¶
Top 20 commands in your bash history¶
sed -e 's/[;|][[:space:]]*/\n/g' .bash_history | cut delimiter=' ' fields=1 | sort | uniq count | sort numeric-sort reverse | head lines=20
Update grub menu.lst¶
sed -e '/^$/d' -e '/^#/d' -e '/initrd/ a\ ' -e 's/hiddenmenu//g' -e '/^timeout/d' -e '/default/ a\timeout\t\t15' -e 's/quiet//g' -e 's/splash/rootdelay=60/g' /boot/grub/menu.lst > /boot/grub/menu.lst.new
delete all leading and trailing whitespace from each line in file¶
Remove space and/or tab characters at the end of line¶
delete all trailing whitespace from each line in file¶
Display email addresses that have been sent to by a postfix server since the last mail log rollover¶
Given process ID print its environment variables¶
Print only the odd lines of a file (GNU sed)¶
Search replace with Ansible style timestamps¶
Exclude inserting a table from a sql import¶
Getting a domain from url, ex: very nice to get url from squid access.log¶
Multi line grep using sed and specifying open/close tags¶
SED - Substitute string in next line¶
remove repeated pairs of characters e.g. "xtxtxtxt" will become "xt"¶
Delete all empty/blank lines from text file & output to file¶
Fix subtitle timing (for .sub files)¶
sed -e 's/{/|/' -e 's/}{/|/' -e 's/}/|/' myFile.sub | awk -F "|" 'BEGIN {OFS = "|"} { $2 = $2 - 600; $3 = $3 - 600; print $0 }' | sed -e 's/^|/{/' -e 's/\([0-9]\)|\([0-9]\)/\1}{\2/' -e 's/|/}/' >
MySQL: Slice out a specific table from the output of mysqldump¶
Comment out all lines in a file beginning with string¶
commentate specified line of a file¶
Remove multiple spaces¶
Simple Comment an entire file¶
Convert a Python interactive session to a python script¶
Add a line from 1 file after every line of another (shuffle files together)¶
print contents of file from first match of regex to end of file¶
Compute the numeric sum of a file¶
Delete leading whitespace from the start of each line¶
Delete leading whitespace from the start of each line¶
Search apache virtual host by pattern¶
Terminal - Show directories in the PATH, one per line with sed and bash3.X `here string'¶
Remove a range of lines from a file¶
Every Nth line position # (SED)¶
sed -n '1,${p;n;n;}' foo > foo_every3_position1; sed -n '2,${p;n;n;}' foo > foo_every3_position2; sed -n '3,${p;n;n;}' foo > foo_every3_position3
In-Place search/replace with datestamped backup¶
Replace spaces in a file with hyphens¶
Delete the specified line¶
Change host name¶
Print just line 4 from a textfile¶
Print just line 4 from a textfile¶
Cleanup a (source) text file, removing trailing spaces/tabs and multiple consecutive blank lines¶
Put uppercase letters in curly brackets in a BibTeX database¶
Prepend a text to a file.¶
Edit Ruby files within the current directory to use Ruby 1.9+ style symbol keys instead of rockets¶
uncomment the lines where the word DEBUG is found¶
Raspberry Pi serial number w/o leading zeros¶
Remove color codes (special characters) with sed¶
urldecoding¶
Remove color codes (special characters) with sed¶
Replace words with sed¶
Rebuild a Delimited File with a Unique Delimiter¶
sed 's/$/uniqueString/' file.old | sed 's/,/\n/g' | sed ':loop;/^\"[^\"]*$/N;s/\n/,/;/[^\"]$/t loop' | sed ':loop;N;s/\n/@/g;/uniqueString$/!b loop;s/uniqueString$//' > file.new
delete all trailing whitespace from each line in file¶
delete all leading and trailing whitespace from each line in file¶
Remove \r (carriage return) in a file¶
delete all leading and trailing whitespace from each line in file¶
Puts every word from a file into a new line¶
Change your e-mail address in multiple files¶
Delete all lines after the first match¶
Extract ip addresses with sed¶
sed replace string in whole files in folder¶
bash chop¶
Printout a list of field numbers from a CSV file with headers as first line.¶
Remove lines that contain a specific pattern(\(1) from file(\)2).¶
Convert Windows/DOS Text Files to Unix¶
insert blank lines¶
Removes lines [range] from file¶
more than 4 repeated characters to a single character¶
Convert camelCase to underscores (camel_case)¶
Tells which group you DON'T belong to (opposite of command "groups") - uses sed¶
Remove blank lines from a file¶
Convert ISO8601 dates to milliseconds since epoch¶
sed "s|\(2[0-9]\{3\}-[01][0-9]-[0-3][0-9]T[01][0-9]:[0-5][0-9]:[0-5][0-9].[0-9]\{3\}Z\)|$(date -d \1 +%s)000|g"
Go to the Nth line of file¶
MySQL: Slice out a specific database (assumes existence of the USE statement) from mysqldump output¶
Remove color codes (special characters) with sed¶
Only change the first occurrence of the pattern¶
Remove the first line containing 'match' from file¶
replace deprecated php-function split in php files¶
File without comments or blank lines.¶
Comment out all lines in a file beginning with string¶
Remove color codes (special characters) with sed¶
Replace strings in files¶
pick up 3 lines start at every 5th line of file.txt¶
Regular expression search pattern to remove the Datetime and Name when you paste from skype chat into your text editor¶
Analyze Apache Web Log Statistics starting on DATE x¶
Duplicate a line in a text file and replace part of the duplicated line¶
Format a password file for John the Ripper from Cisco configs (Level 5)¶
sed -n 's/[ :]/_/g; s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' < cisco-device-config > passwd
HTML esacaping with sed¶
Parse bookmarks and download youtube files¶
Remove color codes (special characters) with sed¶
Extract specific lines from a text file using Stream Editor (sed)¶
Insert line(s) at top of file using sed¶
Extract XML from an otherwise plain text log file¶
List the CPU model name¶
Edit hosts file to remove "foo.novalocal" from it where foo is the hostname of a new VM¶
convert html links into plain text with link anchor¶
delete first and last line from file¶
Remove comments from files¶
Sort a one-per-line list of email address, weeding out duplicates¶
Join lines split with backslash at the end¶
Cut everything until last slash¶
Remove all space before a line¶
Print only NUM line¶
Remove all leading and trailing whitespace from end of each line¶
Print everything after /¶
Print everything after stalled¶
Cut all spaces infront of all words¶
Make space very 3 word¶
Cut after every third line¶
Print with tabular¶
Resources¶
https://fabianlee.org/2018/10/28/linux-using-sed-to-insert-lines-before-or-after-a-match/
Last update: August 10, 2022
Created: August 10, 2022
Created: August 10, 2022