How to add a line to beginning of a file
Run the following command
This is a perl one liner that will append text to the beginning of a file.
PS It edits the file in place so please backup your file first before running.
perl -i -ple 'print q{PUTYOURTEXTHERE} if $. == 1; close ARGV if eof' myfilename
This is a perl one liner that will append text to the beginning of a file.
PS It edits the file in place so please backup your file first before running.
perl -i -ple 'print q{PUTYOURTEXTHERE} if $. == 1; close ARGV if eof' myfilename
Comments