add header in each file of folder

My files location

Dir=/pp/Output/Test/

I have 100 .txt files on above location.

I want add header "pt all" on each file.

Sample Text file

Hi
Kalol
Jt all
q

Output i want

lt all
Kalol
Jt all
q
sed -i '1i pt all' *.txt
1 Like

To Remove first header line

for i in /pp/Output/Test/*.txt
do
sed '1 c\pt all'  $i
done

To add Line before fist line is - Just replace c with i

for i in /pp/Output/Test/*.txt
do
sed '1 i\pt all'  $i
done