[Ilugc] How to delete multiple patterns from a text file easily?
- From: baskar@xxxxxxxxxxxx (Baskar Selvaraj)
- Date: Sun, 8 Sep 2013 06:41:17 +0530
How to do this in a single command?
sed -e 's/[123-]/ /g' <your_file_name>
remove the 'g' at the end if you want to replace only the first
instance (in the line).
Thanks for this useful tip.
sed is a good choice for replacing text in files, as I am using it in
Fedora kickstart files for modifying many of the system configuration files
after post installation.
S.Baskar
Other related posts: