Then they look up the IPs, see that 123.456.78.90 was connected through a Comcast account. They send a big pile of requests to Comcast with all of the Comcast IPs and ask "hey, who had the IP 123.456.78.90 on January 14th, 2016 at 4:50pm?"
Not sure how often they actually bother suing actual users these days but either way, the ISP got the complaint and turns around and sends you a letter saying "hey, stop downloading tv shows and movies over torrents or we will have to cut off your service."
I'm sure the details of how this works change and are more complex but that's the essence. Even if you aren't sued, your ISP will cut you off if you keep torrenting stuff and generating complaints from rights holders.
Said isp has been "only show in town" for serious internet access for some time so thankfully that is starting to change so a move might be on the cards.
A rights-holder watches a torrent swarm for one of their copyrighted works and records the IP of people who are sharing it.
They then contact your ISP (just asking nicely) telling them what they saw. The ISP will usually send you a warning or two before cutting off your service.
Alternatively the rights holder can get a judge to issue a subpoena obligating the ISP to give up your name.
So, since no one is watching Ubuntu swarms and reporting the uploaders, that's not really a concern.
And the police doesn't make those request so lightly... they would need to know you actually uploaded and shared a tons of movies/copyrighted material linking to them on some public accessible site to even think about asking a judge permission to investigate further.