SHOP PRODUCTS
Houzz Logo Print
premio53

What is a well organized Linux book for beginners?

premio53
17 years ago

I want a book that explains all the basics and will demonstrate step by step on how to download and install applications off the internet. Freespire is excellent as far as shielding new users from the DOS-like commands, but it seems to not go beyond the GUI and mouse clicking would leave one stunted.

For an example of "step by step" instructions for "beginners" check this out:

http://www.luv.asn.au/overheads/compile.html#source

Compiling a simple C program.

What you need

Debian packages: gcc, cpp, binutils, libc-dev. C++ programs also require: g++, and libstdc++

RedHat packages: egcs, cpp, binutils, glibc-devel. C++ programs also require: egcs-c++, libstdc++.

gcc and egcs

gcc is the standard Linux compiler, 2.7.2 is the latest stable version.

egcs is a breakaway development of gcc. This has since been renamed to gcc.

From /usr/doc/gcc/README.Debian.gz in gcc-2.95.2-0pre2:

As of gcc-2.95, optimisation at level 2 (-O2) and higher includes an optimisation which breaks C code that does not adhere to the C standard. Such code occurs in the Linux kernel, and probably other places.

There are a couple of 272 packages for Debian potato (unstable) to get around this - gcc272, gcc++272.

The program

/* hello.c */

#include
int main(int argc, char *argv[])

(
if (argc > 1)

printf("Greetings %s.\n", argv[1]);

else

printf("Please tell me your name.\n");

return 0;

)

Compile using:

> gcc -Wall -o hello hello.c

Run with:

> ./hello Linus

Greetings Linus.

gcc options

-o

output file name, (a.out if omitted)

-Wall

display warnings for many possible errors

hello.c

file to be compiled, can specify multiple .c files

The info pages (info gcc) has much more information about gcc. These are in the gcc-doc package.

The Path

Typical Linux path:

$HOME/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin: /usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/games

$HOME/bin

user's personal bin directory

/usr/local/bin

programs installed by the local sysadmin

/bin

programs required during startup

/usr/bin

most executables

/usr/X11R6/bin

X11 programs

/usr/games

Games

sbin

programs which are normally only run by the superuser (root)

. (dot, current directory)

should be last item in path, or preferably not at all.

If you don't have "." in your path then you will need to run programs by using ./name

Scripts

* first line is #!/path/interpreter

* chmod +x script-name

> cat > tryme #!/bin/sh

echo "This is a test script."

EOF

> chmod +x tryme

> ./tryme

This is a test script.

If that is a "Beginners Guide" just call me stupid!

Comments (4)