To disable a device temporarily in Ubuntu, we can use modprobe command.
To list the modules we can use:
sudo modprobe -l
If you get error like:
modprobe: invalid option -- 'l'
Then try this:
sudo lsmod
For example to disable the webcam I can execute the below command:
sudo modprobe -r uvcvideo
When the computer restarted, the webcam will enabled again.
Or if you want to enable it without restart:
sudo modprobe uvcvideo
Reference: