imgx64
July 1st, 2010, 05:15 AM
A little more than half a year ago, I installed Ubuntu on my computer. The method I used for learning to use it was 'Try out all menus, if all fails, Google it.' It generally worked fine, especially with the GUI and all, and there are plenty of help sites online. However, the more I use it, the more I get interested in it. And sometimes, solutions on some websites make me feel left out; Even though they worked, I didn't really understand what they did. And these little cryptic one-liner sh/sed/awk/perl/etc commands have some kind of magic in them; Magic I couldn't fully appreciate, and couldn't modify to suit my needs.
So, at some point, I decided to learn the Unix part of Ubuntu (Yes, I know Linux isn't real UNIX™. But for my intents and purposes, it's Unix enough.) But before I start learning, I needed to know what and how to learn. After some extensive (well, sort of) research, I decided to start from the bottom; I would learn Unix the way it was meant to be, Version 7 Unix! I got two books, The Unix Programming Environment by Brian W. Kernighan and Rob Pike, and Unix Programmer's Manual, the manual for Version 7 Unix. The latter contains two volumes, the first is the man pages of V7 and the second is a collection of papers, essays, and tutorials. It's also available for free online (http://cm.bell-labs.com/7thEdMan/). I also found a PDP-11 emulator and a running copy of Unix V7 (http://simh.trailing-edge.com/).
Now, I started reading the books and learning, and it has been an enjoyable experience. Suprisingly, not much has changed in over 30 years; Most commands work just like they did on V7. However, while almost nothing was removed, a lot has been added, some as standard additions (added to POSIX,) and some as non-standard extensions. As an example, the sh man page in V7 contains about 3000 words (the biggest man page in V7), the bash man page has 41025. That's over 13 times bigger, and that's without counting the texinfo manual of bash! What's more, I found out that zsh is even more advanced than bash, and has even more features. That is just one example, other commands also had their share of additions and there are also many new commands.
I am facing a dilemma here, I don't know what to learn or where to stop. I have two solutions (plus the gray area in between.) The first solution is to stick with just the basics. The problem with that approach is that I will miss many features that could make my life much easier. Also, I risk not understanding some commands/scripts that other people write, which is the reason I started learning in the first place.
The other solution is knowing no limit, learning every command, reading about every option, trying every feature, exploring every nook and cranny, and maybe even learning perl(which, if the Internet is any indication, is simultaneously the best AND worst solution of any problem.) This is obviously impossible, as it will take an unlimited amount of time. I will also have a problem if I ever had to use a system that doesn't have some of these extensions. Also, if I ever try to help someone, they might not have them (for example, giving a command that works in zsh and not in bash.)
Naturally, a reasonable person would suggest starting with the basic set, and learning the extras gradually as I need them. But even that has problems. First, if I don't know something exists, how can I learn to use it? And second, no manual page or book tells you "this feature is available in bash but not in dash, and zsh does it but using different syntax." Which is really the same problem as with the previous appraoch; When helping others or trying to write portable code, how do I know what works where?
I understand this problem is universal, and it would happen even if I picked up a 'modern' book about Unix in general, Linux, or Ubuntu. So, I am hoping you share your own experiences, how do you manage it? How do you learn about these features? How do you know when to stop learning about one command and its extensions and move on to the next one? And do you have any other suggestions for me? Maybe recommend a good book or website?
Note: in case I wasn't clear enough, I'm not just talking about the different shells. Even though my examples were mainly about shells, I also have problems with additions to other programs, awk has been extended, sed has been extended, ed has been extended, even cat has been extended, and the list goes on and on.
So, at some point, I decided to learn the Unix part of Ubuntu (Yes, I know Linux isn't real UNIX™. But for my intents and purposes, it's Unix enough.) But before I start learning, I needed to know what and how to learn. After some extensive (well, sort of) research, I decided to start from the bottom; I would learn Unix the way it was meant to be, Version 7 Unix! I got two books, The Unix Programming Environment by Brian W. Kernighan and Rob Pike, and Unix Programmer's Manual, the manual for Version 7 Unix. The latter contains two volumes, the first is the man pages of V7 and the second is a collection of papers, essays, and tutorials. It's also available for free online (http://cm.bell-labs.com/7thEdMan/). I also found a PDP-11 emulator and a running copy of Unix V7 (http://simh.trailing-edge.com/).
Now, I started reading the books and learning, and it has been an enjoyable experience. Suprisingly, not much has changed in over 30 years; Most commands work just like they did on V7. However, while almost nothing was removed, a lot has been added, some as standard additions (added to POSIX,) and some as non-standard extensions. As an example, the sh man page in V7 contains about 3000 words (the biggest man page in V7), the bash man page has 41025. That's over 13 times bigger, and that's without counting the texinfo manual of bash! What's more, I found out that zsh is even more advanced than bash, and has even more features. That is just one example, other commands also had their share of additions and there are also many new commands.
I am facing a dilemma here, I don't know what to learn or where to stop. I have two solutions (plus the gray area in between.) The first solution is to stick with just the basics. The problem with that approach is that I will miss many features that could make my life much easier. Also, I risk not understanding some commands/scripts that other people write, which is the reason I started learning in the first place.
The other solution is knowing no limit, learning every command, reading about every option, trying every feature, exploring every nook and cranny, and maybe even learning perl(which, if the Internet is any indication, is simultaneously the best AND worst solution of any problem.) This is obviously impossible, as it will take an unlimited amount of time. I will also have a problem if I ever had to use a system that doesn't have some of these extensions. Also, if I ever try to help someone, they might not have them (for example, giving a command that works in zsh and not in bash.)
Naturally, a reasonable person would suggest starting with the basic set, and learning the extras gradually as I need them. But even that has problems. First, if I don't know something exists, how can I learn to use it? And second, no manual page or book tells you "this feature is available in bash but not in dash, and zsh does it but using different syntax." Which is really the same problem as with the previous appraoch; When helping others or trying to write portable code, how do I know what works where?
I understand this problem is universal, and it would happen even if I picked up a 'modern' book about Unix in general, Linux, or Ubuntu. So, I am hoping you share your own experiences, how do you manage it? How do you learn about these features? How do you know when to stop learning about one command and its extensions and move on to the next one? And do you have any other suggestions for me? Maybe recommend a good book or website?
Note: in case I wasn't clear enough, I'm not just talking about the different shells. Even though my examples were mainly about shells, I also have problems with additions to other programs, awk has been extended, sed has been extended, ed has been extended, even cat has been extended, and the list goes on and on.