How do you get the move smash on Pokemon pearl?

First you need to go to Jubilife city , then you go to your right and then you'll see a cave.It's called the Oreburgh gate and the first man you see will give you the HM Rock smash.