Sayyiduna Ibn Abbas (may Allah be pleased with them) reports: A man cursed the wind in the presence of the Prophet (peace and blessings be upon him), so the Prophet (peace and blessings be upon him) said: "Do not curse it, for it is under the command of Allah, and whoever curses something that does not deserve to be cursed, the curse returns upon the one who uttered it."
Related hadith on this topic