0

I go to OS X Terminal, sometime people just give me the command grep , ls, some people called it is shell script , some people call it unix shell. I also got a term bash shell, Bash command. So, I would like to make it clear. What is this all about? Also, if I want to master the grep, ls, and see the whole manual of the shell staff, what document should I look for? Because I see some documents about Linux command, etc also have this functions. In MS DOS, I can have a list of Dos Command. Do the OS Terminal have this thing too? Thanks.

A list of Dos Command:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

1

3 Answers 3

1

The only real way to explain all these terms is with a history lesson.

So we start right at the start, with UNIX in the 70s. Way back before graphical interfaces, the command-line is your only interface to the OS. And given that the center of an OS is called the 'kernel', some nut decided the outer layer should be 'shell'. Terrible puns remain a theme in UNIX.

Still today, Terminal.app is essentially just emulating the physical terminals used to access shells 40 years ago. We 'open a terminal' instead of pulling up a chair, but that's really the most fundamental change.

Because UNIX was written by programmers, initially for themselves, they made this shell programmable. We call these scripts - just as an actor can follow a script, so a shell can follow a 'shell script'. Usually (hopefully) not fully-fledged programs, but a very useful level of automation.

Most parts of UNIX can be (and have been) replaced, including the shell. So when Stephen Bourne wrote a replacement for Ken Thompson's shell, it became the Bourne Shell - and Ken's, the Thompson Shell. And in time, the C Shell (sea shell? very punny), the Korn Shell, and on and on.

At this point, 'UNIX shell' becomes a generic term for any UNIX shell. While there's syntactic differences between them, pretty much any UNIX command can be written at any UNIX shell. So this term is used when the difference simply didn't matter. It's specific enough to avoid confusion with non-UNIX environments (anyone remember DOS Shell?), but generic enough that we don't care sh vs csh vs tsch vs ksh ...

When GNU came to replace the Bourne Shell, they named the replacement the Bourne-Again Shell - 'bash'. Last pun, I promise. While it's really just another UNIX shell, it's currently the most wide-spread - and has been the most widespread throughout the Linux and Internet 'boom years'. So you'll hear 'command', 'UNIX command', 'terminal command' and 'bash command' used interchangeably, 'UNIX shell' and 'bash shell' used interchangeably, etc. However, due to the syntactic differences between the various shells, when they say 'bash script' they usually do mean bash - and likewise, 'shell script' usually also means 'bash script', unless stated otherwise.

0

The OSX Terminal is a linux bash shell. This is similar to a DOS command prompt, but the underlying operating system is linux instead of DOS. Hence the commands used are different and the syntax for scripts (batch files in DOS) is also different.

A list of the commands available in OSX Terminal is available from the SS64 website. For each of the commands, help is available in several ways. You can start by clicking the Links button on the ss64 site, and then on OSX Man Pages. That will take you to the Apple Developers site. At the Terminal prompt, typing "man " will bring up the linux manual pages for that command. If you type the command and then right-click on it you can select to view the same manual.

If you need to write scripts, you will need to look up bash. The reference manual is available from gnu.org. A PDF version is available as well.

2
  • OS X is not based on linux, it's based on BSD Unix. Linux, on the other hand, is essentially a Unix clone. Oct 15, 2013 at 0:53
  • @Gordon You're right of course. While I can't use it an excuse, linux is almost a synonym for unix these days.
    – hdhondt
    Oct 15, 2013 at 2:56
-1

Explanation of Apple OSX Terminal http://www.apple.com/osx/apps/all.html#terminal

list of commands - http://ss64.com/osx/

No Unix Shell Command list on OSX that I know of.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .