Linux is a free, open source operating system, released under the GNU General Public License (GPL). Anyone can run, study, modify, and redistribute the source code, or even sell copies of their modified code, as long as they do so under the same license.
Is Linux really free?
Linux is one of the most prominent examples of free and open-source software collaboration. The source code may be used, modified and distributed commercially or non-commercially by anyone under the terms of its respective licenses, such as the GNU General Public License.
How does Linux earn money?
Linux companies like RedHat and Canonical, the company behind the incredibly popular Ubuntu Linux distro, also make much of their money from professional support services as well. If you think about it, software used to be a one-time sale (with some upgrades), but professional services are an ongoing annuity.