Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the best unix programming book to begin with?

688 views
Skip to first unread message

onlooker

unread,
Apr 27, 2016, 7:18:53 AM4/27/16
to
I've got a moderate knowledge on c and, now I'm planning to learn unix
programming so, in order to learn I've bought the following books
Advanced programming on unix environment, 3rd ed. by Stevense & Rago,
Advanced Unix Programming, 2nd ed. by Rochkind,
Unix System Programming - Concurrency and Thread, by Robbins & Robbins
Beginning Linux Programming, by Mathew et el.
Linux Programming by Example, by Robbins.
with couple of other ebooks such as
Linux System Programming by Love,
Unix system Programming by Haviland,
The Linux Programming Interface, by Kerrisk.

But I'm really confused which book I should study first.
Many suggest to read APUE and some say AUP. I can't understand
the differece between the two books.
Please suggest something.

jr

unread,
Apr 27, 2016, 7:44:16 AM4/27/16
to
On 27/04/2016 12:18, onlooker wrote:
> I've got a moderate knowledge on c and, now I'm planning to learn unix
> programming so, in order to learn I've bought the following books ...
> But I'm really confused which book I should study first.
> Many suggest to read APUE and some say AUP. I can't understand
> the differece between the two books.
> Please suggest something.

my suggestion is: decide on a small, pleasant project, begin working on
it and use your (plentiful) lot of books -- tip, decent books will have
proper indices and references -- to read up on things whenever you hit a
problem.

hth

--
regards jr.

contact -- no months, no hyphens.

Rainer Weikusat

unread,
Apr 27, 2016, 8:13:41 AM4/27/16
to
onlooker <vec...@rediffmail.com> writes:
> I've got a moderate knowledge on c and, now I'm planning to learn unix
> programming so, in order to learn I've bought the following books
> Advanced programming on unix environment, 3rd ed. by Stevense & Rago,
> Advanced Unix Programming, 2nd ed. by Rochkind,

[...]

> But I'm really confused which book I should study first.
> Many suggest to read APUE and some say AUP. I can't understand
> the differece between the two books.
> Please suggest something.

Based on owning a copy of APUE 1st ed, the "supporting anything but
Windows is just too cumbersome!" stuff the author of the other as put on
the web and on me almost immediately finding something useful I'planning
to have a look into when browsing through the APUE 3rd ed web page, I
suggest the former.

Nicolas George

unread,
Apr 27, 2016, 8:18:29 AM4/27/16
to
jr , dans le message <nfq8fv$ejc$1...@dont-email.me>, a écrit :
> my suggestion is: decide on a small, pleasant project, begin working on
> it and use your (plentiful) lot of books -- tip, decent books will have
> proper indices and references -- to read up on things whenever you hit a
> problem.

I would add this advice:

And get your code reviewed by experienced developers.

Even with good books, misunderstanding a point and learning bad habits is
possible.

One easy way and win-win way of getting code reviewed is to contribute to a
Libre Software project. A lot of projects have lists of not-so-hard tasks
that serve as qualification for Google Summer of Code, Outreachy or similar
programs, they can also serve as ideas even for people who do not intend to
apply.

onlooker

unread,
Apr 27, 2016, 10:01:30 AM4/27/16
to
On Wed, 27 Apr 2016 16:48:43 +0530, onlooker <vec...@rediffmail.com>
wrote:
Thanks. I wanted to know about the best book amonst the books(hard
copy/soft copy) to begin learning unix programming and the difference
between APUE and AUP.

Rainer Weikusat

unread,
Apr 27, 2016, 11:51:27 AM4/27/16
to
onlooker <vec...@rediffmail.com> writes:

[...]

> Thanks. I wanted to know about the best book amonst the books(hard
> copy/soft copy) to begin learning unix programming and the difference
> between APUE and AUP.

So, what's your theory what I was writing about?

Jens Thoms Toerring

unread,
Apr 27, 2016, 5:00:15 PM4/27/16
to
I've read (or skimmed) only a few of these books. My absolute
favourite for a long time was APUE (the last version by Stevens)
but nowadays I'd go for Kerrisk's TLPI (though I've got to ad-
mit that I may be biased, having been asked to do a bit of re-
viewing for the book by Michael).

But then none of these are books you're likely to read from
front to back like an adventure novel. If you actually have
all of them (makes me a bit jealous;-) and you want to find
out about a certain topic you should read the chapters about
that in several of the books (the better ones manage not to
require too much knowledge from previous chapters) and make
up your own mind what fits the way you learn best. Different
people tend to prefer different ways of how information is pre-
sented - some like a hands-on approach, mostly from example pro-
grams, while others want some theoretical introduction before it
comes to the implementation details. That's why there are a lot
of books, many of them being very good!

Keep in mind that there's no book that, once you've read it all,
will guarantee that you know everything. A long time ago I read
Kernighan & Ritchie (2nd ed.) front to back and thought "now I
know everything about C". While I still consider it to be a
very, very good book I was completely wrong. 25 years later
I'm still learning new things. And UNIX is a much broader
subject...
Regards, Jens
--
\ Jens Thoms Toerring ___ j...@toerring.de
\__________________________ http://toerring.de

Ian Collins

unread,
Apr 27, 2016, 6:37:56 PM4/27/16
to
On 04/28/16 09:00, Jens Thoms Toerring wrote:
> onlooker <vec...@rediffmail.com> wrote:
>> I've got a moderate knowledge on c and, now I'm planning to learn unix
>> programming so, in order to learn I've bought the following books
>> Advanced programming on unix environment, 3rd ed. by Stevense & Rago,
>> Advanced Unix Programming, 2nd ed. by Rochkind,
>> Unix System Programming - Concurrency and Thread, by Robbins & Robbins
>> Beginning Linux Programming, by Mathew et el.
>> Linux Programming by Example, by Robbins.
>> with couple of other ebooks such as
>> Linux System Programming by Love,
>> Unix system Programming by Haviland,
>> The Linux Programming Interface, by Kerrisk.
>
>> But I'm really confused which book I should study first.
>> Many suggest to read APUE and some say AUP. I can't understand
>> the differece between the two books.
>> Please suggest something.
>
> I've read (or skimmed) only a few of these books. My absolute
> favourite for a long time was APUE (the last version by Stevens)
> but nowadays I'd go for Kerrisk's TLPI (though I've got to ad-
> mit that I may be biased, having been asked to do a bit of re-
> viewing for the book by Michael).

Is it a generic Unix book, or Linux specific? I tend to avoid the
latter due to the goal posts moving faster than authours can keep up!

--
Ian Collins

Jorgen Grahn

unread,
Apr 27, 2016, 7:31:55 PM4/27/16
to
On Wed, 2016-04-27, onlooker wrote:
> I've got a moderate knowledge on c and, now I'm planning to learn unix
> programming so, in order to learn I've bought the following books

> Advanced programming on unix environment, 3rd ed. by Stevense & Rago,
> Advanced Unix Programming, 2nd ed. by Rochkind,
> Unix System Programming - Concurrency and Thread, by Robbins & Robbins
> Beginning Linux Programming, by Mathew et el.
> Linux Programming by Example, by Robbins.
> with couple of other ebooks such as
> Linux System Programming by Love,
> Unix system Programming by Haviland,
> The Linux Programming Interface, by Kerrisk.

IMO, you should also read

%A Eric Steven Raymond
%T The Art of Unix Programming
%S Addison-Wesley Professional Computing Series
%I Addison-Wesley
%D 2004

which is also available online.

> But I'm really confused which book I should study first.

Like someone else wrote, let a hobby project drive your learning Unix.
You don't read books like these from page 1 to N (except the Raymond
one, which has a different focus).

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Jens Thoms Toerring

unread,
Apr 28, 2016, 4:55:19 AM4/28/16
to
I'd say it's rather a generic UNIX book, but with additional
information on where Linux deviates from or extends POSIX. So
you can use it as a UNIX reference if you skip the parts that
are clearly marked as Linux-specific. And there are also often
annotations describing where other systems (like BSD, Solaris,
True64, Mac OS X etc.) deviate from POSIX/SUSv4.

Best regards, Jens

sp...@potato.field

unread,
Apr 28, 2016, 5:35:37 AM4/28/16
to
Indeed. And for most unix & linux systems programming a book describing the
Posix functions should be fine so I'd go for AP in the Unix Enviroment since
its pretty much the definative guide.

One downside is it doesn't go in depth into TCP or UDP network programming so
I'd also recommend Unix Network Programming also by Stevens if its still in
print.

--
Spud

onlooker

unread,
Apr 28, 2016, 9:16:34 AM4/28/16
to
Oh! Yes. got it. Thanks a lot.
Already starting with APUE.

onlooker

unread,
Apr 28, 2016, 10:09:11 AM4/28/16
to
On 27 Apr 2016 21:00:11 GMT, j...@toerring.de (Jens Thoms Toerring)
wrote:
Thank you very much for your advice.
I know reading only books doesn't me an expert. I've purchased all the
'used' low-priced edition and acquired a few ebooks from www.

Running the example code from APUE and AUP seem to be challenging as
each one presents different kinds of problems. One has to make and
link apue library in order to run all the code from APUE and AUP code
are heavily laden with error checking macros that I find it difficult
to understand.
I am a beginner.
At times I studied two ebooks, Unix System Programming by Keith
Haviland and Linux System Programming by Love (mostly snippets).
Code are comparatively clean and easy to understand.

P.S I've two pdf copies; UNIX Systems Programming For SVR4 and
Using C on the UNIX System. Both are written by David A. Curry but I
dared not follow... . :)

onlooker

unread,
Apr 28, 2016, 10:22:12 AM4/28/16
to
On 28 Apr 2016 08:55:16 GMT, j...@toerring.de (Jens Thoms Toerring)
wrote:
Now, as I understand it might be the reason that many suggest to link
commands & tools to /usr/xpg4/bin instead of /usr/bin.

onlooker

unread,
Apr 28, 2016, 10:39:45 AM4/28/16
to
On Thu, 28 Apr 2016 10:37:50 +1200, Ian Collins <ian-...@hotmail.com>
wrote:
It seems to be the only book purely written on Linux. "Linux System
Programming, 2nd ed." by Robert Love. As the author says;
"This book is about system programming on Linux.
Put another way, the topic of the book is Linux system
calls and low-level functions such as those defined by the C library.
While many books cover system programming for Unix systems, few tackle
the subject with a focus solely on Linux, ... .

onlooker

unread,
Apr 28, 2016, 10:42:05 AM4/28/16
to
On Thu, 28 Apr 2016 10:37:50 +1200, Ian Collins <ian-...@hotmail.com>
wrote:

Jens Thoms Toerring

unread,
Apr 28, 2016, 12:48:45 PM4/28/16
to
onlooker <vec...@rediffmail.com> wrote:
> It seems to be the only book purely written on Linux. "Linux System
> Programming, 2nd ed." by Robert Love. As the author says;
> "This book is about system programming on Linux.
> Put another way, the topic of the book is Linux system
> calls and low-level functions such as those defined by the C library.
> While many books cover system programming for Unix systems, few tackle
> the subject with a focus solely on Linux, ... .

There's a huge amount of overlap because Linux is a version
of UNIX, and UNIX systems (nowadays) have a rather well-de-
fined common system API. It's usually a good idea to refrain,
as far as possible, from using extension that work only on
one of the systems since it precludes that your programs
can also be used on other UNIX systems. So I'd also as
others here prefer a book that concentrates on the com-
mon UNIX API and makes it very clear what is stuff that
only works on certain systems.

What you shouldn't expect from a system programming book is
a detailed description of the C library - that's not a sys-
tem-specific API but it's the same on every system for which
a C compler exists (UNIX, Windows and more exotic (hosted)
ones). The functions from the C standard library aren't low-
level - they're implemented on top of the system API (e.g.,
fopen() will call open(), fwrite() write() etc. on UNIX sys-
tems). You better always try to stay aware of what's from
the C API and what from the system API - mixing them can
be dangerous. E.g., using fwrite() (from the C standard
library) and write() (from the UNIX API) on the same open
file can lead to very "interesting" results unless you're
very careful.

James K. Lowden

unread,
Apr 28, 2016, 8:01:43 PM4/28/16
to
On Thu, 28 Apr 2016 19:39:00 +0530
onlooker <vec...@rediffmail.com> wrote:

> One has to make and link apue library in order to run all the code
> from APUE and AUP code are heavily laden with error checking macros
> that I find it difficult to understand.

You have two good choices here, and one bad.

The bad choice would be to blindly run the example code and prove to
yourself ... what? That it compiles and runs. No great advantage to
you.

The good choices are to understand the code or re-write it without the
wrappers. The wrappers aren't very complex; they just implement what
you yourself would have to do to check for errors. (They also serve
to emphasize the value of checking for errors.) If you satisfy
yourself that's the case, maybe you'll be more comfortable using
them. Alternatively, you could lift the code out of the wrappers and
run it "bare", as it were, adding your own error-checking.

There's a lot of bad sample code out there. Doesn't work, is too
complicated for what it does, is too trivial or precious to change
slightly without needing multiple fixes. Stevens' code doesn't suffer
from those ills. It's clear, pedagogically useful, and reasonably
functional. Worth spending time with, even if it's a little weird at
first.

--jkl

James K. Lowden

unread,
Apr 28, 2016, 8:01:49 PM4/28/16
to
On 27 Apr 2016 21:00:11 GMT
j...@toerring.de (Jens Thoms Toerring) wrote:

> But then none of these are books you're likely to read from
> front to back like an adventure novel.

OTOH, that's exactly what I did, both with Steven's books and TLPI.

OP: You can't expect to remember everything, and some details will be
too intricate to study on the first pass. But you get the lay of the
land, and remember enough to know what was discussed, and where to go
back for a closer look. The immersion gives a better grasp of the
whole, how things fit together (and sometimes don't).

I also recommend one of McKusick's books on BSD. A view from the
inside makes the syscall interface easier to understand and
rationalize. In the same vein, Plauger's The C Standard Library.

--jkl


0 new messages