[HN Gopher] The UNIX Programming Environment (1984)
       ___________________________________________________________________
        
       The UNIX Programming Environment (1984)
        
       Author : phantom_of_cato
       Score  : 94 points
       Date   : 2022-08-26 07:42 UTC (1 days ago)
        
 (HTM) web link (archive.org)
 (TXT) w3m dump (archive.org)
        
       | ralph84 wrote:
       | The AT&T logo on the cover is a reminder of how many of the
       | foundations of modern computing came out of Bell Labs.
        
       | enneff wrote:
       | This is a great book, one of my faves. It is a surprise to see it
       | hosted on archive.org when it is still in print, though. Please
       | support good technical writing!
       | 
       | https://www.amazon.com/Unix-Programming-Environment-Prentice...
        
       | [deleted]
        
       | iamjk wrote:
       | I love this book! There is a lot of abstraction today that most
       | software workers benefit from, but I think there is a lot of
       | value in understanding lower-level mechanisms.
        
       | avgcorrection wrote:
       | I wish this was a history book.
        
       | georgia_peach wrote:
       | Chapter 5 is the best intro to shell programming I've ever read.
       | If you read it for that purpose, don't skip chaps 1-4.
        
       | pengaru wrote:
       | This book has an exceptionally high signal:noise ratio. It's long
       | been a favorite of mine, even with its relatively high price tag
       | for a small paperback.
        
       | npalli wrote:
       | Chapter 8 was the most surprising part of the book for me when I
       | first read it. Up till that point lot of the information was
       | mostly what seemed like administrator/user territory. Then BAM!
       | it goes into designing a full fledged interpreter for a BASIC
       | level complexity language, suddenly you are into language design;
       | utterly fascinating how using simple tools like yacc, lex and
       | some simple code (the entire code for the interpreter is
       | published in the Appendix) you can do amazing things as a
       | programmer.
        
       | theonemind wrote:
       | You have to read this so that when inodes come up at your
       | sysadmin/devops social gathering's scintillating conversation you
       | don't have to run to the bathroom and google it on your phone and
       | try muddle your way through without your face turning red.
       | 
       | (inodes just strike me as one of those weird little things like
       | SQL, except for much smaller/easier to learn--just something
       | critical, always there, and for some reason, not understood by a
       | lot of sysad/devops types. I forgot the detail until rereading
       | this book recently. I imagine you can expect the details to vary
       | widely on modern filesystems, but ext4 (descending from and
       | backwards compatible with ole ext2) probably has the concept, and
       | BSD's ffs/ufs, and the idea probably gives you some hazy idea of
       | this general area of the world for a lot of filesystems
       | 
       | I also find the treatment of some old topics kind of
       | illuminating, like the stty command when I do obscure stuff like
       | use serial terminals or try to use a text buffer as a tty--
       | interesting that you can still tell the kernel "hey, do this
       | dirty hack for my terminal when handling characters and things.
       | Thanks.")
        
         | buildbot wrote:
         | Nobody thinks about inodes until suddenly your disk is full,
         | but df tell you it is not ;)
        
           | zvr wrote:
           | Of course, the same df can show you what's happening with
           | inodes, if used with the -i flag.
        
           | jaxrtech wrote:
           | You should be able to see inode usage with `df -i`, no? I
           | usually use `df -Tih` (print the file system type, list inode
           | usage, in human-readable format).
           | 
           | I've had the other case where `df` says the disk is full with
           | plenty of inodes left, but then `ncdu` says there is plenty
           | of space (supposedly).
           | 
           | Lo' and behold, you have some borked process still holding
           | GBs of log files open that you thought you "deleted" --
           | really unlinked from a directory.
           | 
           | tl;dr: Don't forget `lsof +L1` to find pesky processes that
           | are holding files open that you _unlinked_ from a directory
           | but have yet to be actually marked as deleted on the
           | filesystem [1]. The space on disk won 't be freed until the
           | process closes the files or is terminated. (Technically, the
           | open files are associated with a mount point, not the file
           | system itself, which makes dealing with symbolic links across
           | file systems somewhat confusing.)
           | 
           | [1]: For example, see
           | https://unix.stackexchange.com/a/141639/332116)
        
         | mgaunard wrote:
         | Any software engineer should have written a filesystem during
         | their bachelor's degree, and should be well familiar with the
         | concept of inodes.
        
           | userbinator wrote:
           | Not every filesystem has the concept of inodes. The FAT
           | family, for example, or ISO 9660.
        
             | KerrAvon wrote:
             | Nor the Apple file systems, BeOS, NTFS. It's really
             | specific to the original Unix file system and direct
             | derivatives.
        
           | lamp987 wrote:
           | well maybe not that, but it is very surprising that there are
           | software engineers out there who dont know what inodes are.
           | on my uni this was explained in an OS class in year 2 of
           | bachelors programme. its basic knowledge.
        
             | Tijdreiziger wrote:
             | Operating Systems was an elective in my bachelor's program.
             | It's certainly not basic knowledge.
        
               | pjmlp wrote:
               | So there are engineering degrees without OS knowledge?!?
        
               | Tijdreiziger wrote:
               | Yes, and on the other hand, there are surely also degrees
               | with OS knowledge, but without AI knowledge. And degrees
               | with AI knowledge, but without 3D graphics knowledge.
               | And... well, you get the point.
        
           | nineteen999 wrote:
           | You don't need a bachelor's degree to write an ext2
           | filesystem driver, I didn't finish high school and I've
           | written a read-only one that works on both MSB (68000) and
           | LSB (x86) byte order machines. The format is well documented:
           | 
           | https://www.nongnu.org/ext2-doc/ext2.html
           | 
           | https://wiki.osdev.org/Ext2
        
       | nsxwolf wrote:
       | Skimming this makes me long for the time when the multiuser
       | nature of Unix was really utilized as intended.
       | 
       | I miss being on a system and typing "who" to see who is on, and
       | starting a chat with them with "talk". Or sending mail to other
       | users just on that system. Using "finger" to read updates in
       | their .plan files.
       | 
       | Many of the "social" aspects of the internet today existed in
       | that multiuser aspect of Unix, in a much more intimate way.
       | 
       | Macs and Linux machines are still multiuser systems, but "users"
       | are pretty much just used to provide separate configuration and
       | permissions scoping for different application services. It would
       | be nice to have someone hop onto a terminal on my Mac once in
       | awhile and say hello.
        
         | billyhoffman wrote:
         | Sounds like you should join a Pubnix!
         | 
         | https://tilde.team/
        
           | michaelsshaw wrote:
           | Very interesting! Thanks for this!
        
           | pengaru wrote:
           | I didn't enjoy my tildeverse experience personally.. there
           | are others like SDF:
           | 
           | https://sdf.org/
        
             | rafram wrote:
             | What do you enjoy more about SDF? (I haven't tried either,
             | just curious.)
        
               | pengaru wrote:
               | I just didn't enjoy the social/cultural aspects I
               | encountered on the tildeverse, it was quite immature and
               | dysfunctional based on my experience ~2 years ago.
        
           | grimgrin wrote:
           | Here's some I found, that one on the list
           | 
           | https://github.com/cwmccabe/pubnixhist/tree/master/systems
           | 
           | I'm not sure it is entirely that helpful, but it IS a list!
        
         | LtWorf wrote:
         | > but "users" are pretty much just used to provide separate
         | configuration and permissions scoping for different application
         | services.
         | 
         | Uh? You let your kids and wife use your same account? Are you
         | insane?
        
       | NegativeLatency wrote:
       | This book is a very fun read and was awesome for understanding
       | why some of the Unix stuff works the way it does
        
         | spapas82 wrote:
         | Agreed, this is an excellent book. I would definitely recommend
         | it even today to people that want to improve their understand
         | of unix/linux.
        
       ___________________________________________________________________
       (page generated 2022-08-27 23:00 UTC)