When it comes to linux, I'm the man.
So hit me with your questions!
how the HELL do u install a certain program on FC2? aw illak, where the hell can i get a list of the commands used? since, u know, without the commands, there's no use of linux
interesting here's one for you rolf, what is the best *free* downloadable linux build?
It really depends on what you want.
One of the most popular is Fedora (used to be called redhat)
i have heard about Suse linux too, supposedly easy

FreeBSD is well known for servers, although it's not really linux, it's a pretty different system.

http://www.linux.org/dist/
11 days later
rolf, supposedly you're the master of the masters in Linux and yet you didn't answer a simple question as:
"where the hell can i get a list of the commands used?"

Charly, you're question is interesting, but wrong somehow.
Most of the commands in Linux are programs. Lets take "ping", its not a command, its a program. Usualy if you're a normal user all the "commands" which are "programs" are located in your /bin and
if you're root, then few extra "commands" are in /sbin/

you really don't need to memorize all of them, you just have to know what to use and what each command does.
A good way to discover this is by using the man program, which basicaly means: Manual. ex: man mii-tool will give you:


MII-TOOL MII-TOOL

NAME
mii-tool - view, manipulate media-independent interface status

now, if you want do do something but you don't know which program/command to use then www.google.com/linux, if you want to know what commands you used earlier, then there is "history" which can be piped with "grep" so lets say you want to see all the latest ping commands you typed earlier then you do: history | grep ping.

another cool tool to use is "apropos", type "apropos network" and you'll have the list of tools you can use for networking for example.

Hope that helped,
join the mailing list of www.leglug.org
or you can press the tab key twice .. you will get a list of the programs/commands that you have.
that's not the productive way for searching a command ;)
:D hehe yea you're right ! but i wanted to help :P what shall i do ?
sorry charly, I missed your post.
type $PATH in your console windows, and you'll see the list af all directories that linux searches when you type a command.
If you add up all commands in these directories, you'll end up with more than 1000 for sure...

Thanks for the history and apropos tricks, I didn't know them, and I'll be using them for sure.

The tab can be very useful, but your apropos thing is much better when you dont know the name of the command.
sorry charly, I missed your post.
type $PATH in your console windows, and you'll see the list af all directories that linux searches when you type a command.
If you add up all commands in these directories, you'll end up with more than 1000 for sure...

Thanks for the history and apropos tricks, I didn't know them, and I'll be using them for sure.

The tab can be very useful, but your apropos thing is much better when you dont know the name of the command.
you mean, type: echo $PATH
typing $PATH by itself will execute whatever is in $PATH
[root@summer root]# $PATH
-bash: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin: No such file or directory

------------
"No such file or directory"
umm, you're right :D
Thanks for the leglug link. Great idea.
Do you plan on organising any "installfests" (people get together to install linux)? Or other similar events?
And it would be nice to add a link to lebgeeks.com in the links section, to support the development of the tech community in lebanon.
Hi,

you said you do your shell scripting in PHP. Good thing you deleted that ;)
don't let anyone hear you say it.

It's like trying to read the contents of a directory by implementing "ls" in assembly.
The thing is I have more than 2 years experience in PHP, and I really didn't feel like learning a new language as bizarre as bash from scratch, so I just went with PHP, and I'm actually pretty happy with it. Here I'll show you the code that I use to read the output of a command in PHP.
for example to know if host 1.2.3.4 is up and report unreachability in the syslog:
#!/usr/bin/php -q

$ip = 1.2.3.4;

exec("ping $ip -c 2 -W 2|grep "64 bytes"", $aOut);
if (count($aOut)!=2) {
            exec("logger Host $ip is down.");
        }
It is true that you have to write more code to process the output, but on the other hand I find PHP to be more readable and it has a lot of additional features, like tons of extensions, objects, etc... But I have to say reason n.1 is that I already know it inside out.

One PHP feature that I use for example is raw sockets. I use it to automatically log me into the GDS login page. This way I always stay connected and never see that annoying login page.
#!/usr/bin/php -q

$ip = 1.2.3.4;

exec("ping $ip -c 2 -W 2|grep "64 bytes"", $aOut);
if (count($aOut)!=2) {
            exec("logger Host $ip is down.");
        }
not only is this too much code, everything you need is already there, and you're adding the PHP syntactic sugar around it, here's the one line bash version:
$  (ping google.com -c 1 | grep "64 bytes") || logger "Host google.com is down.";
it's no point to use PHP since you're exec'ing the commands already.
rolf,
If you wanna become a *NIX system administrator, or apply advanced tasks on *NIX, then Bash/Perl are essential. Along with mastering regular expressions and tools (grep,awk, sed...)
Yeah, I am planning on starting perl.
I have already used regular expressions in PHP. I'll look into awk and sed, thanks!

megalomania, this is from the grep manpage:
Normally, exit status is 0 if selected lines are found and 1 otherwise.
But the exit status is 2 if an error occurred, unless the -q or --quiet
or --silent option is used and a selected line is found.


how does that map to true/false?
megalomania, this is from the grep manpage:
Normally, exit status is 0 if selected lines are found and 1 otherwise.
But the exit status is 2 if an error occurred, unless the -q or --quiet
or --silent option is used and a selected line is found.


how does that map to true/false?
0 is false, everything else is true.
(Update: in shell it's the opposite, 0 is success (so true) and everything else is not. So the above statement is wrong, the reverse is true.)

with that in mind, you only care to see if grep matched, which should return 0, otherwise, you consider a failure.

"2 if an error occurred" is not what you think it is. This is an error in "grep", and not in "ping", which does not mean that the host is down.

So in any case, you only care if you get a ping reply, which should match in grep, and which should return you a 0. Otherwise there may be a million reason why the ping didn't return, but since you don't account for these in your original code, I didn't account for them in mine.