Sed
Sed
Remove the 1st line
Remove the first 100 lines (remove line 1-100)
Remove lines with string (e.g. 'bbo')
Remove lines whose nth character not equal to a value (e.g. 5th character not equal to 2)
Edit infile (edit and save to file), (e.g. deleting the lines with 'bbo' and save to file)
When using variable (e.g. $i), use double quotes " "
Using environment variable and end-of-line pattern at the same time.
Delete/remove empty lines
Delete/remove last line
Delete/remove last character from end of file
Add string to beginning of file (e.g. "[")
Add string at certain line number (e.g. add 'something' to line 1 and line 3)
Add string to end of file (e.g. "]")
Add newline to the end
Add string to beginning of every line (e.g. 'bbo')
Add string to end of each line (e.g. "}")
Add \n every nth character (e.g. every 4th character)
Concatenate/combine/join files with a seperator and next line (e.g separate by ",")
Substitution (e.g. replace A by B)
Substitution with wildcard (e.g. replace a line start with aaa= by aaa=/my/new/path)
Select lines start with string (e.g. 'bbo')
Delete lines with string (e.g. 'bbo')
Print/get/trim a range of line (e.g. line 500-5000)
Print every nth lines
Print every odd # lines
Print every third line including the first line
Remove leading whitespace and tabs
Remove only leading whitespace
Remove ending commas
Add a column to the end
Add extension of filename to last column
Remove newline\ nextline
Print a particular line (e.g. 123th line)
Print a number of lines (e.g. line 10th to line 33 rd)
Change delimiter
Replace with wildcard (e.g A-1-e or A-2-e or A-3-e....)
Remove last character of file
Insert character at specified position of file (e.g. AAAAAA --> AAA#AAA)
Last updated