Amtrak, Long Island Rail Road and Metro-North Railroad all own and operate passenger yards in New York City.
There are also many yards operated by the New York City Subway system.
CSX Transportation and New York & Atlantic Railway own and operate freight yards in the city.
Furthermore, there are rail yards on property owned by the city of New York, but leased to freight railroads including New York New Jersey Rail.
See Rail freight transportation in New York City and Long Island.