Due to the complicated and changing circumstances of the sea environment, path planning technology is essential for unmanned surface vehicles (USVs) to fulfill search tasks. In most cases, the location of the underwater target is unknown, so it is necessary to completely cover the search area. In this paper, the global static path is planned using a parallel line scan search. When encountering unknown obstacles, the improved Bug algorithm is used for local dynamic path planning according to the sensor detection information. This paper first sets up the safe expansion area to ensure the safety of the USV during the obstacle avoidance process and optimizes the movement direction considering the operation and behavior characteristics of the USV. To meet the requirement of USV steering, the Bezier curve is used to smooth the path points, which greatly improves the smoothness of the path. In this paper, the multi-mode switching strategy of the Bug algorithm based on obstacle boundary width obtained by the sensor is proposed, which ensures no area omissions and meets the requirement of search area coverage during the process of bypassing obstacles. The simulation results show that the improved Bug algorithm can maintain a safe distance along the obstacle boundary to bypass the obstacle. Moreover, the improved Bug algorithm effectively improves the path oscillation phenomenon of traditional Bug and shortens the path length and operating time. Finally, through the global search path planning simulation and comparison experiments, the effectiveness of the proposed method is verified.