Maritime transport relies on a large amounts of fossil fuels. It provides cargo-carrying services but simultaneously emits enormous amounts of by-products such as CO2, which cause climate change. The IMO has adopted mandatory measures to reduce the shipping industry’s greenhouse gas emissions by at least 70% by 2050, relative to 2008. In this paper, we select 11 liner shipping companies as decision-making units (DMUs) that account for more than 80% of the world’s shipping capacity. Utilizing the directional distance function, we estimate their environmental efficiency in 2019, 2020, and 2021. The directional vector serves to expand desired outputs and contract undesirable outputs. The larger the distance, the farther the evaluated unit is from the production frontier, and the less environmentally efficient it is assessed. This study compares the impact of environmental regulations on liner shipping based on two methods of dealing with undesirable outputs. Since the results indicate the low overall environmental efficiency of liner shipping, firms should strengthen their decarbonization efforts to achieve environmental efficiency goals. Moreover, the results also demonstrate that environmental regulations significantly impact liner shipping companies and that they need to reduce by-product outputs to comply with regulations.