rename file, add extensions

Hi Guys,

I have files named myfileaa,myfileab,myfileac,myfilesad.... till myfileav.

Now i needs to rename all these files to myfileaa.txt ,myfileab.txt,myfileac.txt.

Please help me how to do the same.

Thanks in advance..!!!

Are you sure that those have not been generated from the use of the split command ?

If so, you should rebuild the initial big file that has been splitted into smaller files with suffix aa ab ac ad ... by concatenating them.

I have splitted all these files using split command, but the new files dnt hve the .txt extension...

that is the problem..!!!

What split command did you use ? (with which options) ?

---------- Post updated at 10:15 PM ---------- Previous update was at 10:14 PM ----------

for i in myfile*
do
mv "$i" "$i.txt"
done
for d in myfilea{a..v}; do mv ${d}{,.txt};done