I just dumped Windows because it broke on me and replaced it with Ubuntu. I was able to save the character and world files. Where do I put them to be able to use them on my new OS? I know Terraria runs on Ubuntu (am installing it now).
Since the only way to run Terraria on Ubuntu is through WINE as Ben Brocka and lunboks have suggested, I will answer your actual question, assuming that you are using WINE and if you are not, I would suggest that you revise your question to provide more information about your setup.
While I'm sure you knew this if you backed up your files, but to provide background for the answer, as per this question, the default behaviour is for saves to be in
My Documents\My Games\Terraria\Players and worlds to be in
My Documents\My Games\Terraria\Worlds as stated here.
You will want to put your character and world files in the paths mapped for
My Documents\My Games\Terraria\Players and
My Documents\My Games\Terraria\Worlds respectively. The default WINE behaviour if I read correctly is for My Documents to map to your home directory so it would be
home/(user)/My Games/Terraria/Players and
home/(user)/My Games/Terraria/Worlds for your respective username I believe. If you want and this is up to you, you can remap where My Documents maps to in wineconfig, but you will have to adjust where you put the save files accordingly.
Um... You don't need wine. Terraria works on Ubuntu now. There's a Steam for Ubuntu. You can do it through wine if you want but it plays a little slower. Also if you use Ubuntu's steam to install terraria you'll find your worlds in a different folder.
/home/YOURNAME/.local/share/Terraria/ Replace YOURNAME with your username.
You've gotta use WINE, Terraria doesn't run on Ubuntu native. Here's a tutorial on making WINE work with it but I haven't done it myself. I wouldn't expect it to run perfectly but it's a start.