Significant increase of container flows in the marine terminals requires more efficient port equipments such as logistic and transfer systems. This paper presents collision avoidance and routing approach based on dynamic programming (DP) algorithm for a linear motor based shuttle car which is considered as a new transfer system in the port terminals. Most of routing problems are focused on automatic guided vehicle (AGV) systems, but its solutions are hardly utilized for LM based shuttle cars since both are mechanically different. Our proposed DP is implemented for real-time searching of an optimal path for each shuttle car in the Agile port terminal located at California in USA.