AMITIAE - Saturday 15 September 2012


Command Line Work: New Users and Terminal (3) -- Shell Basics


apple and chopsticks



advertisement


By Graham K. Rogers


Terminal


Ever since the first Macs appeared, they have been known for the graphical user interface (GUI): icons instead of command line work which before the mid-1980s was the norm. Paradoxically, the arrival of OS X brought with it easy access to the command line should users ever want this, although it is possible to use the computer without ever needing to work at the command line at all.


shells When users work in UNIX on any operating system (e.g. Linux, Irix) they are insulated from the basics of the operating system itself by a shell. There are several -- some with rather specialised uses. Some users may be familiar with the DOSSHELL file manager that was available with versions of MS DOS.

By default, Terminal in OS X uses Bash: an adaptation of an early shell called Bourne. As an example of the hidden wit that may exist in some computing circles, BASH was so named as it is the Bourne Again Shell. There is a certain wit also to the C Shell.


For most users, there will be no need ever to change the shell, but as users develops skills, they may wish to flex their computer muscles. As there are a number of shells installed with OS X, it is possible out of the box to try them out.

To change to the Bourne shell, the text to enter at the command line is sh, for Shell. Pressing Enter will change the command line and on my computer (with Mountain Lion), this now reads sh-3.2$.

To return to the BASH shell, the text, bash is typed in. When the enter key is the usual computer name and account display is not shown. Instead I see bash-3.2$. This reverts to the normal display when Terminal is restarted.

Other shells that I have found installed on my Mac are:

  • C Shell - csh
  • Korn Shell ksh
  • Z Shell zsh
  • TENEX C Shell tcsh
  • A windowing shell for Tcl/Tk wish
  • Remote Shell rsh


shells There are a number of other shells available including

  • Almquist Shell
  • Debian Almquist Shell
  • Public domain Korn Shell
  • MirBSD Korn Shell
  • Perl Shell (psh)
  • Scheme Shell (scsh).
  • Friendly Interactive Shell (fish) - see below


The above information relates to examining a shell, perhaps before a user decides to use it permanently. If this is wanted, we can use the chpass, chfn or chsh utilities (these are identical) with the -s switch and a space between each part of the command:

chpass -s csh

The user's password will be needed to complete the change and make the new shell the default.


It is also possible to download and install a new shell. One that has found favour with some Mac users is Fish: Friendly interactive shell. The useful online resource, OS X Daily, has an item on how to download and install a development of this: Ridiculous Fish.


There is a fairly informative article on Unix Shells on Wikipedia which also has a number of useful links.


To be continued. . . .



See Also -

  • New Users and Terminal (1) -- A Quick Look Round
  • New Users and Terminal (2) -- Basic Navigation
  • New Users and Terminal (4) -- Lists and Manuals
  • New Users and Terminal (5) -- Internet Use
  • New Users and Terminal (6) -- Questions of Identity
  • New Users and Terminal (7) -- A Little More Discovery
  • New Users and Terminal (8) -- File Commands and More
  • New Users and Terminal (9) -- Process Identification and Termination
  • New Users and Terminal (10) -- Browsing the Web using Unix
  • New Users and Terminal (11) -- Unix Tricks from OS X Daily
  • New Users and Terminal (12) -- Installed Text Editors - emacs, nano, pico, vi and vim
  • New Users and Terminal (13) -- Installing and Using the Utility, WGET
  • New Users and Terminal (14) -- Passwords, Purging and Closing Notes
  • New Users and Terminal (15) -- Permissions and chmod


    Graham K. Rogers teaches at the Faculty of Engineering, Mahidol University in Thailand. He wrote in the Bangkok Post, Database supplement on IT subjects. For the last seven years of Database he wrote a column on Apple and Macs.


  • advertisement



    Google


    Made on Mac

    For further information, e-mail to

    information Tag information Tag

    Back to eXtensions
    Back to Home Page