PDA

View Full Version : Command confusion



horizon981
09-28-2006, 02:30 PM
There seems to be a conflict between Unix and Linux when it comes to commands.
I reading a book on Unix Shell Programming and when I try it out on Knoppix, certain commands do not work, e.g.

$who am i
$ls *p (although $ ls p* works)
$ls [aeiou]*
$ls a?n

Why is it so? Is there something else called "Linux Shell programming".

Harry Kuhman
09-28-2006, 04:36 PM
Why is it so?
welcome.

I'm not an expert at shell programming (have been in past lives but not for Linux). Linux is actually the name of the the OS Kernel, the rest of the tools are from the GNU (http://www.gnu.org/) library. You might want to look up what the TLA GNU stands for. On good place to start is here (http://en.wikipedia.org/wiki/GNU). There are also several somewhat different shells provided, and of course there would be no reason for multiple shells if they all looked and ran the same. And yes, the world and particularly the web is filthy with Linux documentation (you do know how to use Google, don't you?)

Jacky
09-28-2006, 05:26 PM
Actually, these commands and options which you have listed all work as expected. I have just verified them again, with the exception that "who am i" should be one word: "whoami".

You probably think they didn't work because you executed them in a directory that doesn't contain many files and so the ls commands did not return anything. Try cd /usr/bin and do the commands again. Lots of files to be found there.

Regards.

horizon981
09-29-2006, 02:34 AM
Yes!! :D
Thanks a lot!!