Ibn ‘Abbas told how the Prophet said, when a man cursed the wind in his presence, "Do not curse the wind, for it is under command; if anyone curses a thing which does not deserve it, the curse will return on himself."
Tirmidhi transmitted it and said this is a gharib tradition.