Abstract Discontinuous gaits for walking machines offer great advantages over wave gaits, and they seem more adequate for following a path over irregular terrain. This paper, focused on quadruped walking robots, addresses the problem of following an arbitrary path using both discontinuous crab and turning gaits. First, the paper presents the algorithms to generate these gaits as local motions and highlights their advantages in comparison with continuous gaits. This comparison considers stability, velocity, power consumption and terrain adaptability. The algorithms for tracking an arbitrary trajectory using these gaits are then introduced, and some simulations and experimental results are reported.