In general, this sort of thing is much easier to do with a GUI. In gnome (and probably kde) I just put a blank CD or DVD in the drive and wait for the recorder app to pop up. Then I drag files or directories into it and tell it to write the disk..
Doing it on your own will require to you do a couple of steps manually.
First you have to create an image for the CD/DVD you want to create. This is done with the mkisofs command similar to this:
mkisofs -R -o cdimage.raw /home/joerg/master/tree
Then, when you have the image, you can write to the disk as follows:
cdrecord -v speed=2 dev=2,0 cdimage.raw
Unfortunately, there are a lot of options to cdrecord, and it's sometimes difficult to even figure out what "dev=" should point to. I believe you have to run "cdrecord -scanbus" if it doesn't like /dev/cdrom or /dev/dvd.
The examples above came from this page. http://www.linuxcommand.org/man_pages/cdrecord1.html