Book recommendation

What would be a good book that teaches linux programming? I was thinking about "The Linux Programming Interface" by Michael Kerrisk, is it good, should I get it? Or are there better alternatives? I just need something to get me started with linux programming, like system specific libraries and so on. Thanks in advance.
It depends on what you want to do. If it's system stuff, there's a relatively old book:
Advanced UNIX Programming
Warren W. Gay
(c) 2000 SAMS
Thank you, I will check the book out.
Programming for Linux is almost exactly the same as programming in any other OS, don't panic and have some fun with it.

The biggest difference is the plethora of free libraries out there, and often more of a focus on cross-platform coding. You might also find Bash to be more powerful than any IDE once you set up your tools as you like them, but most of the IDE's you are used to are also available on Linux (some written originally for Linux so the tools work better).

I suggest you check out the free books under C++ section on this github page. (I'm pretty sure this guy only includes books that are offered under a free-use license.) https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#c-1

If you decide on Qt programming;
The GUI Qt3 book there is a little too old since they are on QT5 now, Any books you find Qt4 and up should be mostly compatible with Qt5 coding practice, I think Qt5 mostly just added more objects on top of Qt4.

The Open-Source License Issue;
One thing that might put you off from Linux programming is the scare that everything you make has to be open-source, otherwise you risk getting sued. This is way over the top. Everything that you make yourself is yours. Just be careful of the libraries that you include because some of the Licenses may include your code in their scope.

You'll want to read the GPL and LGPL licenses since they are the most prevalent in Linux, I tend to avoid libraries that use plain GPL because it's the most firm and restrictive of the two (it's the one that wraps your code into it's snare). LGPL is pretty easy to conform to, and may even allow you to keep closed-source (and sell your program) if you don't modify the original library code and you should link dynamically to the libraries (so the user can choose not to use the library that is under LGPL).

Even better, there are a lot of other licenses out there like the zlib or the bsd licenses which generally protect you the coder from being sued if your code doesn't work as expected, but make no requirement as to your having to share your code if you use their libraries.

I must apologize for the off-topic portions, but these are things you should study further into before you just pick and chose certain libraries that are out there especially since GPL is not just lurking on Linux, but it is in a lot of libraries that you might use without thinking about it on MS, Mac, and smartphones as well.

3 Key Ideas;
Linux does not equal GPL.
1 minute spent googling a library before #include will be enough to tell you what license it is under, GPL does not hide itself.
You can sell your code even under GPL - ( https://www.gnu.org/licenses/gpl-faq.en.html#DoesTheGPLAllowMoney )
Last edited on
Golden Lizard I read the wiki for the book you mention, It looks like a good one if you want to directly interact with features in the kernel. ( https://en.wikipedia.org/wiki/The_Linux_Programming_Interface ) There are benefits to this approach since the kernel has so many features that no cross-platform library could take them all into account. By my understanding it would also be challenging since it's possible for the user to compile their own kernel which means that even in the same distro you can't guarantee that the same kernel features are available. Having said that, the book itself seems to discuss an API which hopefully is a layer of abstraction to help alleviate this issue... Either way it sounds intense.

Apparently I didn't read your original post very well; I read the request for books and somehow skipped the rest of the post. It kind of invalidates just about everything I say in my previous post since I was not talking about programming this deeply into Linux. You specifically said you're looking for system specific libraries so you probably don't have any concerns about cross-platform issues...

Still, on top of that book maybe try out the github page I mentioned, here's the linux portion;
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#linux
This section is a little mashed together of everything linux, but there is likely to be something in there for wherever you interests lay.
Last edited on
Topic archived. No new replies allowed.