Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'll give you some background info before I start asking away.
I have my CCNA & A+ certifications. Not the best certs, but it's a start. My main goal is to broaden my knowledge, learn to program, and to learn Linux.
I have used Linux in the past, but know virtually nothing about it. I have used and installed Ubuntu, but only as a GUI, and have never touched the CLI. Knowing my goals, which distro do you guys think would I learn more from? At the same time, which distros are more programmer friendly (Come with IDEs or pre-installed programs to help me learn, if any?)
While I do know that a lot of programming languages can be similar, I'm still wondering which to approach first. I would like to start out with a language that has an easier syntax and fairly easy to pick up. Hopefully after mastering one, I can pick up others with ease. So my second and final question is simple and I know it gets asked a lot. Which programming language is easiest to learn first, and why?
Also if anyone knows of any tutorials that aren't completely boring and mind numbing, that would be awesome as well. Thanks in advance for all of your input!
Any distro gives you access to the cmd line aka cli, so if you like Ubuntu, you can stick with that (to start).
All the major distros have stuff like IDEs (may need to install with GUI).
At work I'm used to only having the cli env and using vim
Historically, real servers don't have a GUI ...
Bash is going to take a little getting use to, or so it seams!
I am looking to learn an actual programming language as well. I've read up a bit on python, perl, and C. However, I know nothing about Perl. It's worth looking into though. It's a little overwhelming, having so many options available, to be honest.
Thanks for all the links and response. Looks like I have some reading to do!
One other question, though. How do you feel about running Ubuntu, or any other distro, on a VM? I currently Virtual Box on my PC. Are there any major drawback, or do you suggest just installing it on another partition?
For what you want to do, running it in a VM should be fine. The only time I might recommend against it is if you plan to be doing heavy graphics work (there can be issues with virtual graphics cards, or at least there were back when I looked into it).
As for programming, what do you want to develop? I personally like Python a lot (good for rapid development and IMO easier to read than Perl), however it's not ideal for everything. For example low level system programming or very performance critical code would probably be better written in C or even assembly (but of course a Python or Perl interface can be built to C code).
I actually think I'm going to start with Python. I don't have any goals in mind yet. Just trying to broaden my horizans and learn new skills. I've only played with Python and Java so far, but Python just seems easier and more straight forward. It seems like I spend too much time defining classes and what-not in Java. Python just feels "right" somehow. Thanks for your input!
I think Java has a cleaner syntax than most programming languages.
Java needs an unfortunate amount of stupid looking overhead to make a minimal program. It is easier to copy someone else's "hello world" program in Java and then edit it to do whatever simple job you want, vs. write a simple Java program "from scratch".
Java also has a significant amount of declaration overhead (certainly compared to Python) to add the simplest variable or function to a program.
But Java is a much better language than Python and those overheads are a large part of the reason.
The design of Python encourages you to slap together a mess of a program quickly. For the simplest programs that design just makes it quicker to get from zero to trivial, and you won't see the flaws in the language design.
But as you try to get from trivial to real, the design of python and the bad habits you pick up writing trivial Python programs will lead to badly structured programs that are hard to grow and enhance.
Java is a much better language than Python. C++ is a much better language than Java, but enough harder to learn that I wouldn't try to give C++ as the answer to your request.
Bash is a programming language with such a nasty unreadable syntax, it is almost the opposite of your request for an easy syntax. That may be a necessary consequence of bash's role as a simple command line syntax that extends smoothly up to a full programming language.
You asked about learning command line Linux as well as asking about learning a programming language. But if you would use bash just as a command line processor, there is little point to even learning command line Linux. You could do almost everything easier and better in GUI mode. For the occasional thing you need to do by command line, you could just paste some command you found online (such as in an answer here at LQ) into a terminal window and not worry about why it works. To get real benefit from command line Linux, you should learn bash as a programming language, despite its nasty syntax.
I strongly disagree that Java is unconditionally a much better language than Python. Sure, you can write absolute sodden messes of unmaintainable Python code (I've done this, I'm rather ashamed to admit), but the same can be said for Java. At the end of the day, it's down to the skill of the programmer, not the language, although I agree some languages (e.g. Perl, bash) make it much easier to write unreadable masses of code. I'd disagree, however, that Python falls into this category. Sure, it has the (minor) disadvantage of not being strongly typed, but this should not be a large issue to a careful programmer. Python contains much of the same structure as Java (object oriented with classes, inheritence, etc.). It doesn't necessarily force the programmer to use it the same was as Java does, but the structure is there and IMO much easier to deal with for a beginner (and even a more experienced programmer) than Java. I'm much more of a system admin than a programmer, but I've used both languages extensively. I'd be interested in being shown why I'm wrong, but what you're saying does not square at all with my own experience.
For similar reasons, I dispute that C++ is a much better language than Java. More powerful, definitely, but by that logic the most powerful language would be real mode assembly since you can, quite literally, do anything you well please to the hardware with no pesky OS or libraries to get in your way. However, C++ commits many of the same sins that you ascribe to Python. To wit, it does not force the user into an OO paradigm. Witness the fact that most valid C programs (even those written in a purely procedural style) are also valid C++ programs and you'll see what I mean. C++ has some nice features (e.g. multiple inheritence), but Python also has this (whereas Java does not AFAIK -- just a way to both inherit and implement an interface; what C++ or Python would call an abstracy base class). So your ordering of languages Python < Java < C++ makes even less sense to me and IMO is not particularly helpful to the OP. What criteria are you using to judge here?
In each of Python, Java and C++ I have done far more maintenance of terrible code written by others than I have done creation of new code. So that has colored my opinion of the three languages.
In any of these languages, a maintenance programmer frequently comes across a reference to a member of an object and has no clue of the significance of that member. Who set it to what value, where and why?
In Java or C++, one can pretty easily find the declaration of that member through the declaration of the class or its base classes. Similarly an IDE can navigate the class and find you all references to that member.
But in Python, the member is not declared anywhere. You can't even find its type. You can't find all references (assuming like most problem members in most bad code it has a common name for which grep would find a hundred non references for every reference). It is likely only a member of the specific object instance that is being referenced and isn't even a member of other objects of the same type as that instance.
Java and C++ code has much more statically determinable meaning. Looking at the relevant declarations is generally enough to tell you the meaning of a chunk of code. But Python code has meaning much more often determined by the execution history of the program. Without knowing everything the program will have done before reaching a specific point, you often have little clue what the code at that point would do.
There are certainly counter examples: Java or C++ code where you can't begin to guess what might get called at run time by some call in the source code and the only hope of finding the meaning is to set a breakpoint there and run the program in a debugger. But the language design tends against that kind of confusion, where the Python language design favors such confusion.
That's a very interesting discussion going on here ...
Originally Posted by ramos26
...I would like to start out with a language that has an easier syntax and fairly easy to pick up. Hopefully after mastering one, I can pick up others with ease...
C++ has no easy syntax and a much more complicate semantic. That's why I don't suggest to start with C++.
See my following pro/con list of Python vs Java
+ Statically bound (if you don't use reflection ... and you will not use if you start with JavA ;-) )
- Compilation step needed (alternative: Use groovy - but then you will not use Java any more ...)
- Coding overhead in particular for collection handling
- Dynamic binding - allows much more relaxed coding but is difficult to maintain
+ No compilation needed. Just execute the program
+ Powerful collection handling
Frankly I suggest to start with Python - but the drawback will be - you're not forced to get familiar for strong typing. If you will participate in big projects strong typing will be used (Java and c++). If you know you will work in a big development project just start with Java and you will get used to strong typing. If you're supposed to create code for smaller projects I suggest to start with Python. But be aware you'll hate Java later on because you will get used to the freedom you have in Python with typing.
But thank you for all of the insight and wonderful opinions. I took Java in college and hated it for the reasons above. I do see myself moving on to more powerful programming languages in the future, though. I don't know if anyone is familiar with this or not, or if it's even relevant, but I have programmed in a proprietary language called "DM" to make byond games. I did it for a few years while in college and picked it up rathe quickly. They describe their language as :
The language is called DM, and was created specifically for BYOND. It is object-oriented and extremely flexible, using a C/C++ inspired syntax, but without any of the confusing aspects of C++ or Java. People new to programming will find this about the friendliest language around, while experienced programmers will find they can do pretty much anything with it.
To provide a slightly more technical summary, DM is a dynamic-binding, introspective, fully-polymorphic, single-inheritance language. Objects know what they are, can be queried at run-time as to their attributes, and lists can contain arbitrary sets of objects. Thus there is no need for templates. DM has no concept of protected or private functions, and there is no custom operator overloading (though BYOND has some built-in operator overloading). You can extend or override almost any object or function in the system.
With this being known, does anyones opinion change? Would I be easier just continuing with what I know and starting with C++ (Since it is object oriented) or is this going to be a completely different monster than what I have experience working with??
I find it rather strange that you state that you are new to programming when you already had classes in Java and several years experience in another language.
But anyways, in your case, since you don't like Java and have experience in a C/C++ like language it would think that you should try C/C++.
Personally, C has been and remains my favorite language (with Python being #2). Most people don't realize that it's possible to do many OO tricks (including inheritence, polymorphism, and even exception handling) in C, it's just that the language doesn't provide any syntatic support for them (and doing exceptions via setjmp/longjmp is just incredibly ugly, error prone, etc.). Still, I don't necessarily recommend it as a starting language, especially if one wants to learn objected oriented programming, design patterns, etc.
@johnsfine -- interesting perspective. I don't agree with your opinion, necessarily, but you definitely raise a good point about members of any object that can be essentially created in a free-for-all process.
@kindofabuzz -- actually, most of the Java programming I've done is J2EE server side stuff (EJBs, CORBA, and all their friends). It was a long time ago in a previous life, and I always thought that it was a bit over-complicated. Still, lots of big business systems definitely still rely on Java; it's not just for mobile phones!