Delete
sed '5d' Delete line 5 sed '/[Tt]est/d' Delete all lines containing Test or test sed 's/...//' data Delete the first three characters from each line of data sed 's/...$//' data Delete the last 3 characters from each line of data Delete all occurrences of a pattern in a file using sed command This is a simple application of the /s flag where the target string is none. For example, to remove all occurrences of word "line" in the above file, the sed command would be bash-3.00# sed 's/line//' textfile.txt This is 1 This is 2 This is 3 This is 4 This is 5 Note that the word to be replaced upon matching the pattern is none in the above command ('/s/line//') To remove all occurrences of the character space in the above input file, the sed command would be bash-3.00# sed 's/ //g' textfile.txt Thisisline1 Thisisline2 Thisisline3 Thisisline4 Thisisline5 Also note that if you don't use single quotes in the above s...