How to add a prefix string at the beginning of each line in Bash shell script on Linux? For example, assume we have a file a.txt: line 1 line 2 I want to have, pre line 1 pre line 2 You may use sed, the stream editor for filtering and transforming text: sed -e 's/^/pre […]
The post How to add a prefix string at the beginning of each line in Bash shell script on Linux? appeared first on SysTutorials.