Reply
Thread Tools
Posts: 842 | Thanked: 1,197 times | Joined on May 2010
#1
*** Note: This may need to be moved to General - But, I figured this was better ***

Have a Linux question? Ask away.
Are you a Linux guru, or even just a power user? Feel free to answer others questions.

This topic is for answering all manner of Linux questions, and helping people convert to some version of the most awesome* OS ever

*IMHO

Well? Ask away!
 
Posts: 307 | Thanked: 157 times | Joined on Jul 2009 @ Illinois, USA
#2
If I were looking for a Linux indoctrination course, explaining to me how to use GCC, how to use some sort of package management system, how to use the command line (eg, how do i know which commands/programs are valid/installed/callable?), and most importantly, how to learn/where to go to learn all this stuff so it makes sense?

For instance, when I say how to use GCC, I mean what the hell is ./configure. What is it, how do I use it, why does it exist/what other options are/were there?

If I want to start at the very basic level, I want to customize a linux system for myself, but I can't do that because I don't know what tar.gz is (ok I know its a linux zip file) and whats even more interesting/confusing is that I thought linux didn't have file extensions? I thought there was a big file somewhere listing the permissions of each file and that was it.

While we're at it, what are my package management options? What are their differences? What do each of them *do* exactly? I thought when I compiled something it just gets turned into executable bits. What are all these executable formats (eg: PE, and other ones I can't remember)? Why are there so many cryptic commands that do the same thing (apt-get install vs dpkg?)

On the command line I can type "vi blahblahblah" and it will open up a vi editor, or I can type "top" and it will show me stuff. Thats all good and fine, but how do I know what I can type? Why can I run vi from the command line but I have to type the full extension of other programs?

I know what the X-Window system is. I've followed tutorials on how to work with different window managers and its all fairly simple. Why can't I do that on my n900?

Basically I want to know what is everything, why is it included, how does it work, why does it work, when does it work, what does it do, why don't we use this other better thing, whats the difference between competitors? and other questions.
 
Posts: 162 | Thanked: 25 times | Joined on Dec 2009
#3
@mmurfin87: You ask much and my advice is: start small... and don't use the N900 to learn Unix/Linux.

Install e.g. Ubuntu on a partition of your desktop computer or use andlinux or cygwin to run it under Windows. Or use a terminal program like Putty to login at your N900, so you 'll have at least a normal keyboard and screen. In that case, you should first install openssh on your N900.

Then, get acquainted with the commandline and shell scripting. For an editor, you can use vi, but any other will do (I recommend Joe to my students). Familiarize yourself with the unix tools (grep, more, sort, tr, cut, to mention a few). There are many tutorials out there: you might try http://paai.uvt.nl/Paai/Onderw/Compg


GCC and ./configure are needed when you want to compile a program locally. ./configure should be followed by 'make' and 'make install'. Often ./configure will stop because you first have to install additional programs or libraries.


Believe me, Unix and the CLI are a joy to use and extremely powerful. But it takes time to learn and it is not necessary for the everyday use of the N900.

Paai
 
Posts: 540 | Thanked: 387 times | Joined on May 2009
#4
That is a TON of questions.

I do NOT recommend "Learning Linux" from an embedded device such as the N900. Stick with Linux installation on a desktop/laptop or even live-cds if you have to. For partitioning burn a GParted LiveCD. Go with Grub1 (0.97) instead of Grub2 so you can get an understanding of boot parameters.

Attempt a Gentoo install, I'm sure by the time you have that up and running most of your questions will be answered (I am kidding, that's a cruel way of indoctrinating someone into Linux - I know because I was talked into that when I was n00b. Very masochistic distro.)

Compiling packages can vary, A LOT. Especially if you are cross-compiling.
The "standard format" is:
1. Download the source archive
2. Uncompress (x) it with tar, piping it through gunzip (z), be verbose (v) and use file (f). Use tab-completion to fill in the filename (press Tab twice or CTRL+I on some distros). If it's a *.tar.bz2 then subsitute z with j (tar xjvf foo.tar.bz2)
Code:
$ tar xzvf coreutils-5.0.tar.gz
3. From the shell navigate into the newly created folder
Code:
$ cd coreutils-5.0.tar.gz
(Optional) List the contents of the current folder
Code:
4. $ ls
5. See the configure options available for this particular package if any, for example ./configure --prefix=/usr Then run ./configure (with any parameters if needed)
Code:
$ ./configure --help
$ ./configure
6. Run Makefile through GCC
Code:
$ make
The compiled binaries can be run from the directory such as
( cd src; ./hostname OR /src/hostname )
7. As root install the compiled binaries in the appropriate places in the userland.
Code:
# makeinstall
As far as extensions go, a lot of the older stuff still uses extensions and really extensions make a lot of things easier. For example a common way to package source code is as a .tar.gz, which is a tar file inside of gzip file. Archives use compression which is basically poor man's encryption (I'm not saying that's the intended purpose) meaning the program can not necessarily easily discern the mimetype header information to determine the filetype, particularly if there is any corruption. Hence the file extension is still useful.

Binaries tend to lack a file extension but is because the files are run directly and have executable permissions set. Additionally scripts usually lack a file extension (but is useful as a hint) because they have a shebang (examples: #!/bin/bash #!/bin/perl #!/local/bin/python)

Before you go and remaster a distro or go so far as to attempt as Linux-From-Scratch you should simply try out as many distros as you can and see how they vary. I would try: Ubuntu (Debian-based), Fedora (Redhat-based), Puppy, pre-5.0 Knoppix, Sabayon, Gentoo and really as many as you can. You'll see that they vary greatly. See here: http://en.wikipedia.org/wiki/List_of..._distributions
Find an old desktop (or really just a hdd that doesn't have any files you want) and burn a bunch of ISOs, wipe the hdd and play with some different distros. They all have their pros and cons.

Package managers are an entire discussion by themselves and not even in regards to a comparison of the different formats (.deb, .rpm, .ebuild, .runz, etc)

Regarding your comment about vi. That's to do with the PATH variable.
$ echo PATH
and you'll see directories such as /usr/bin listed, you can append other directories to your PATH variable (you should be able to use .bashrc for persistence)

GCC all I'm going to say it's don't attempt this on N900 and for Ubuntu-based you'll need the package build-essential among others.
Code:
# g++ INPUTFILE.c -o OUTPUTFILE `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`
Compiling is taking a human-readable file and making it machine-readable and typically build for that specific hardware (for efficiency)

Dist-masters choose which packages they want to include in their repos. For example debian-based use man-db and redhat-based (and other traditionalists) choose to still use man.

There are a lot of competing projects, just look at Gnome and KDE and their respective GTK and QT libraries.

Beryl and Compiz used to be competing projects but now they have merged as Compiz Fusion.

The Xorg you use on a Desktop is actually more-than-likely x11-xorg which is a fork of x11-xfree86.

A good resource of the GNU/Linux history is Wikipedia. I recommend you read up on the GNU userland and other deviations/alternatives such as the [failed] Gobolinux project.

You certainly have a lot of questions. Google is your friend, along with Wikipedia and also the forums unix.com and linuxquestions.org
Here's a couple of links that may be of some use:
http://wiki.maemo.org/index.php?title=Terminal (I wrote up some of that but it's been changed a lot since then)
http://ss64.com/bash/

Your best bet is to learn to love terminal. Everything in Linux revolves around it. Learn about VTs and the screen command while you are at it.

The man command will help you out a lot. info is competing help file system. You can also often command --help

Specific questions help, as "teach me Linux" is just plain impossible. No one knows everything and it's something that you simply learn more about every day. You simply need to use it as your primary OS.

Good luck. Get to know Tux

P.S. I made a 'lil "cheater" function for Step1-3:
Code:
$ wtzc () { wget "$@"; foo=`echo "$@" | sed 's:.*/::'`; tar xzvf $foo; blah=`echo $foo | sed 's:,*/::'`; bar=`echo $blah | sed -e 's/\(.*\)\..*/\1/' -e 's/\(.*\)\..*/\1/'`; cd $bar; ls; }
$ wtzc http://mirrors.kernel.org/gnu/coreutils/coreutils-5.0.tar.gz
 
Posts: 162 | Thanked: 25 times | Joined on Dec 2009
#5
Originally Posted by linuxeventually View Post
That is a TON of questions.

I do NOT recommend "Learning Linux" from an embedded device such as the N900. Stick with Linux installation on a desktop/laptop or even live-cds if you have to. ...
I agree wholeheartedly as you can see. But I don't think that you should try to explain everything in a thread like this. It will probably lead to confusion.

Our friend should really start where we all started and use a dedicated Linux forum to get assistance and pointers to tutorials. And I often compare learning Unix to learning to play a musical instrument: there is no substitute for just sitting down and doing it.

Paai
 
Posts: 992 | Thanked: 738 times | Joined on Jun 2010 @ Low Earth Orbit
#6
Basically what paai said.

Originally Posted by mmurfin87 View Post
For instance, when I say how to use GCC, I mean what the hell is ./configure.
A lot of programs are written to be compatible across a whole range of unix-like/posix compatible systems. What configure does it try to work out what kind of system and environment you have and make the necessary changes to allow the program to compile correctly.

because I don't know what tar.gz is (ok I know its a linux zip file)
To be accurate, the tar bit denotes a bunch of files that have been archived and the gz bit denotes that the resulting tar file has been compressed using gzip.

and whats even more interesting/confusing is that I thought linux didn't have file extensions?
It does have "file extensions" to the extent that all filesystems allow you to name a file "somefilename.someextension", but it doesn't need them. Most programs couldn't care less what you named the files. The file extensions are mainly for convenience so you can see at a glance what a particular file is.

Eg to extract a .tar.gz file you do:

Code:
tar zxf myfile.tar.gz
If you rename myfile.tar.gz to myfile you could extract it just the same:

Code:
tar zxf myfile
On the command line I can type "vi blahblahblah" and it will open up a vi editor, or I can type "top" and it will show me stuff. Thats all good and fine, but how do I know what I can type?
If you press "Tab" twice it will show you a list of all the commands available from your current path (see "echo $PATH"), however the more useful answer is that you will "know what to type" as you get more experienced.

Why can I run vi from the command line but I have to type the full extension of other programs?
Not sure what you mean, got an example?
 
dchky's Avatar
Posts: 549 | Thanked: 299 times | Joined on Jun 2010 @ Australian in the Philippines
#7
The second post asks a lot of very complex questions:

I started with Unix in 1991, moved on to Linux and SunOS / Solaris after that. To this day I'm still learning new things. I was in the Navy back then - it was a pretty hostile environment for noobs : )

Reading. Curiosity. Experimenting. Breaking. Fixing. (With a healthy dose of impossible deadlines) That's how I learned.

Unix System V - A Practical Guide. If you can pick this book up anywhere, I would highly recommend it. It was published 15 years ago, but unix being what it is, it is still as relevant today in the Linux world as it was back then. It will teach you all about the more useful core applications you can expect to have available, what they do, how to use them, and so on.

Alternatively any kind of Linux systems administration book will do the trick. Absorb any of these and you'll know on your own how to find the answers to your questions. Take a look in /bin /usr/bin /sbin /usr/sbin and see what's available. Try running everything you come across or look up the man page for it.

It WILL take you YEARS to learn this stuff. There are no shortcuts unfortunately.
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#8
Originally Posted by mmurfin87 View Post
For instance, when I say how to use GCC, I mean what the hell is ./configure. What is it, how do I use it, why does it exist/what other options are/were there?
http://www.gnu.org/software/autoconf/
http://www.gnu.org/software/autoconf...ode/index.html
http://www.gnu.org/software/automake/
http://sources.redhat.com/automake/a...l#Introduction

Alternatives:
http://doc.trolltech.com/4.2/qmake-manual.html
http://www.cmake.org/

And of course, straight GCC & Make without the crutches. (GCC is not ./configure and ./configure is not GCC. GCC is a compiler, ./configure is part of a tool to automatically identify necessary dependencies and their library/header paths.)

If I want to start at the very basic level, I want to customize a linux system for myself, but I can't do that because I don't know what tar.gz is (ok I know its a linux zip file) and whats even more interesting/confusing is that I thought linux didn't have file extensions? I thought there was a big file somewhere listing the permissions of each file and that was it.
http://en.wikipedia.org/wiki/Tar_%28file_format%29
http://en.wikipedia.org/wiki/Gzip

See also:
http://en.wikipedia.org/wiki/Bzip2

Extensions:
http://learn.clemsonlinux.org/wiki/File_extensions

I have no idea what you mean by a "big file" listing "permissions"... unless you're referring to the filesystem Journal:
http://en.wikipedia.org/wiki/Journaling_file_system

While we're at it, what are my package management options? What are their differences? What do each of them *do* exactly? I thought when I compiled something it just gets turned into executable bits. What are all these executable formats (eg: PE, and other ones I can't remember)? Why are there so many cryptic commands that do the same thing (apt-get install vs dpkg?)
http://en.wikipedia.org/wiki/Package_management_system

On the command line I can type "vi blahblahblah" and it will open up a vi editor, or I can type "top" and it will show me stuff. Thats all good and fine, but how do I know what I can type? Why can I run vi from the command line but I have to type the full extension of other programs?
http://www.reallylinux.com/docs/basic.shtml

I know what the X-Window system is. I've followed tutorials on how to work with different window managers and its all fairly simple. Why can't I do that on my n900?
It's heavily modified.

Basically I want to know what is everything, why is it included, how does it work, why does it work, when does it work, what does it do, why don't we use this other better thing, whats the difference between competitors? and other questions.
http://www.google.com/
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
Posts: 162 | Thanked: 25 times | Joined on Dec 2009
#9
Originally Posted by dchky View Post
The second post asks a lot of very complex questions:
...


It WILL take you YEARS to learn this stuff. There are no shortcuts unfortunately.
Whoops. That is one less potential linux user.

Happily there are ways to make learning palatable. The trick is finding things that you really want to do with your OS, and then apply yourself wholeheartily to doing them.

Paai
 
Posts: 2 | Thanked: 16 times | Joined on Aug 2010 @ Belgium
#10
Originally Posted by mmurfin87 View Post
Why can I run vi from the command line but I have to type the full extension of other programs?
If by 'extension' you mean path, the reason would be the folder that application resides in is not in your PATH environment variable.

To see what folders ARE in your path, you can run echo $PATH

You can add folders to your PATH, and you can do so in various ways. I suggest you google and use the solution that feels the most natural to you.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:49.