I have 2 rasters in GeoTiff format. One has all of the land and water and the other is a mask file that shows either 0 for water or 1 for land. I basically want my output to just have the land values and all the areas that were water in the first image to just be 0,0,0. Is there a way to do this with any of the gdal command line tools?

Basically I want to do what gdal\_rasterize does with a shp file mask but with a raster instead.