quote:
Originally posted by <Speed Racer>:
What is a good site to learn linux codes and such?
This is probably going to be a MUCH longer answer to your question than you were expecting, sorry if that is the case. Maybe it will help someone...
I'll try and help although I am not sure what you mean by "linux codes". If you mean programming and you aren't currently familiar with any type of programming it might be best to start with some basic system programming and some comparisons between Win* and *NIX/Linux (assuming you are already familiar with Win*). Linux comes with many languages ranging from basic shell scripts to C++ and graphical Development environments for KDE ("kdevelop" is similar in many ways to Visual* in MS).
Now on the basic level you have to compare the "shells" between Win* and Linux. A "shell" provides the basic command interpereter and has a number of built in commands. In DOS and all versions of Windows the "shell" is COMMAND.COM. In NT/2000/XP a more enhanced shell is included called "CMD.EXE". In *NIX/Linux you are not limited to a single shell like in Win*. There are several different shells with different built in commands and you pick which shell you want as your default "login shell" (what sort of built in commands and syntax you want available at a shell/command prompt) and all of them provide a heap more functionality than COMMAND.COM and CMD.EXE. Most Linux distros use "bash" as the default shell although you have many more shells to choose from like "ksh", "csh", "sh", "ash", and on and on.
COMMAND.COM in DOS/Windows has built in commands like "DIR", "ECHO", "FOR", "SET", "GOTO", "PATH" and a few more (but not a large number of internal commands). Then of course there are all of the external commands included with the OS usually found in C:\DOS, or C:\WINDOWS\COMMAND, etc.
In *NIX/Linux there are similar commands built into each of the shells plus boatloads more, and exponentially more external commands, commands to do just about everything under the sun, commands you don't find in Windows and when you go back to Windows you wish you had them because you might scratch your head for hours trying to figure out how to do something that is a simple one liner in *NIX/Linux and might require a point and click in some graphical utility in Windows (I'll explain why this is significant later in this message).
CMD.EXE in NT and above has more built in commands and is a significant improvement over COMMAND.COM but still far inferior to any of the *NIX/Linux shells.
Now here is where the most basic and easiest programming (or scripting if you will) starts on both Win and *NIX. In Win you can automate the built in and external commands though a Win* scripting language called "Batch" (or batch files or *.bat files). This script must run under the interpereter (i.e. shell) COMMAND.COM, or *.cmd files under the CMD.EXE shell. You can do very rudimentary programming/automating with batch, in fact you can get somewhat creative but are very limited without the addition of other external commands not included with DOS/Windows.
In *NIX/Linux the equivelant to batch is "shell scripts". Like batch files the shell script must run under one of the shells (bash, ksh, csh, etc). The script will run under your default login shell if you do not specify in the first line of your script a specific shell that you want to program under. At least you have a choice. I prefer the "ksh" (Korn Shell), or "bash" (Bourn Again Shell) for shell scripting. Some people prefer the "csh" (C Shell) for scripting. They all have different syntax and it's more or less a preference thing.
Piping, redirection, and job management are far superior in *NIX/Linux over Win and if you learn batch and also learn shell scripts you will very soon see there is no match.
Who needs shell scripts? Why the heck would I want to automate something? I don't know about you but I hate repetetive tasks (especially with a mouse), it gives you carpotunnel syndrome, and I DO have a computer that should be capable of doing as much of the work FOR me as possible. That way I have plenty of time to do other things like play golf, fly planes, etc... Microsoft has made it darn near impossible to administer a system or use a system without having to use the mouse in some way or another. Sure Linux has graphical tools to that allow you to admin/use the system in similar ways to a Win machine but I RARELY use the graphical tools for anything for a few reasons.
1) It's nearly impossible to automate graphical tools on either platform.
2) I learned the manual ways before the graphical tools were available (on both Win and *NIX).
3) I can do things faster on the command line than I can with a mouse (at least in *NIX/Linux) believe it or not.
4) The command line way is nearly identical on all *NIX/Linux systems, graphical tools are not, so you have a head start in other *NIX systems if you know the command line way of doing things.
In *NIX/Linux anything you can do with a graphical tool you can do on the command line (and a whole heck of a lot more). In Win there are many things you can not do on the command line that must be done with a graphical tool which means they can not be automated, at least in batch. You might have to write a C program to do this which is a lot more work than writing a simple batch file. It has to be written, compiled, debugged, fixed, debugged, fixed, debugged etc etc. (unless you are really good, then you only have to recompile a few times).
Now it certainly is good to learn C but take baby steps, start with Batch and Shell scripts, then maybe go to "Perl" scripting on both *NIX and Win*. Then go to C/C++. STAY AWAY FROM Visual Basic (or Visual anything if you ask me). Visual Basic is certainly not portable, Visual C is difficult to port, use the freebee GNU C/C++ compiler on both Win* and *NIX/Linux. I hate proprietary systems, languages, and practices. Something Microsoft loves and why they have lawsuits against them.
When you get good at batch and shell you will begin to see the light. You will be very pleased but don't think you are some sort of wizard at this point. You'll find the more you learn, there will be exponentially more to learn, at least in *NIX. In Win* you only have a limited amount to learn before you realize it's not really an OS at all, just a wanna be and Microsoft is nothing more than a master at marketing. Ever see that commercial where that guy is surfing the Internet and finishes it? That's Win*. Where win doesn't end is where they keep putting out the same old crap with a different name so they never find the end of your pocket book. You never reach the end of the story in *NIX, even if you never upgrade. Of course *NIX had a significant head start and has evolved from the inputs of more than one small company, based on standards and with interoperability being very significant.
Now I've only given you what might be a section of an "intro" chapter to batch and shell scripting. From here you might want to buy a book ,but I can tell you that usually books are a waste of money. Sometimes you get a good one but I find that is rare. I have shelves full of books that may have only been opened twice and only a few that the covers are worn off. You might as well save your money and just do some google searches. Search for something like "shell scripting tutorial" and "batch file tutorial" etc... You should run accross a wealth of info. Look around until you find something that is well written and understandable to you. If it's not, you didn't waste any money, just go to the next one. You'll be on your way in no time!
---
cat /var/run/windows.pid | xargs kill -9
[ December 07, 2001: Message edited by: VoidMain ]