We present the results of a series of one-dimensional N-body and hydrodynamical simulations which have been used for testing the different clustering properties of baryonic and dark matter in an expanding background . Initial Gaussian random density perturbations with a power-law spectrum P ( k ) \propto k ^ { n } are assumed . We analyse the distribution of density fluctuations and thermodynamical quantities for different spectral indices n and discuss the statistical properties of clustering in the corresponding simulations . At large scales the final distribution of the two components is very similar while at small scales the dark matter presents a lumpiness which is not found in the baryonic matter . The amplitude of density fluctuations in each component depends on the spectral index n and only for n = -1 the amplitude of baryonic density fluctuations is larger than that in the dark component . This result is also confirmed by the behaviour of the bias factor , defined as the ratio between the r.m.s of baryonic and dark matter fluctuations at different scales : while for n = 1 , 3 it is always less than unity except at very large scales where it tends to one , for n = -1 it is above 1.4 at all scales . All simulations show also that there is not an exact correspondence between the positions of largest peaks in dark and baryonic components , as confirmed by a cross-correlation analysis . The final temperatures depend on the initial spectral index : the highest values are obtained for n = -1 and are in proximity of high density regions .