How to enable and disable serial ports on Ubuntu
Today, I had to fix a bug in some software I’m working on. The details of the bug aren’t that important, apart from the fact that the bug only became apparent when the software was run on a system with one or less serial ports.
Since I’m debugging on Ubuntu, and I have two serial ports (/dev/ttyS0 and /dev/ttyS1), I needed to find a way to temporarily disable one. This is how I achieved it.