I am looking for a command line or bash script that would add space 5 times before the beginning of each line in a file.for example:abcafter adding spaces 5 times      abc
add space 5 times at the beginning of each line in a text file
shell script;text processing
With GNU sed:sed -i -e 's/^/     /' <file>will replace the start of each line with 5 spaces.  The -i modifies the file in place, -e gives some code for sed to execute.  s tells sed to do a subsitution, ^ matches the start of the line, then the part between the second two / characters is what will replace the part matched in the beginning, i.e., the start of the line in this example.