Reputation: 1154
i have multiple file like xaa xab xac and i would like to insert the same line in the beginning of all :
here is the command that i found for one :
sed -i '1s/^/id,compressedString,url,categorie,date,name\n /' xad
and i would like to apply it on my multiple files like x*
Thanks and regards
Upvotes: 1
Views: 853
Reputation: 2313
Just use a loop
for f in x*; do
sed -i '1s/^/id,compressedString,url,categorie,date,name\n /' "$f"
done
Upvotes: 3
Reputation: 15461
If files are in same directory, try this:
sed -i '1s/^/id,compressedString,url,categorie,date,name\n /' x*
Upvotes: 2