AMITIAE - Wednesday 12 September 2012


Command Line Work: New Users and Terminal (1) -- A Quick Look Round


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.


I used the command line from the time I first switched on a computer until the death of my last 386 PC and the subsequent switch to a second-hand Mac that a colleague was selling. I have never used Windows: that OS was just arriving when I bought that Mac. When the Internet first arrived here too, there was no graphical component and all work was done at the Unix command line.

When OS X arrived, it was not long after buying my first iMac -- the large polycarbonate one with a CRT monitor -- that I found it was easy to access the Unix via the application called Terminal. Since then, although I work 99% of my time with the normal OS X interface, there are occasions when some subtle changes -- for example to certain applications and how they work -- can be effected more easily at the command line.

Many users, however, take one look at the great gulf that appears before them and run away. Don't run: learn.


Terminal

Terminal is an application that may be found in the Utilities folder of Applications. Using Launchpad it can be seen in the folder marked Other. I drag it to the Dock for easy access.

When Terminal first opens, the user is shown a small window (80 x 24 on my iMac) in which Unix commands may be entered. That size may be a problem for efficient working, but there are three ways round this. At the top right of the panel is the full-screen double arrow. Pressing this fills the screen with the default white panel and that will be enough for most people. Alternatively, the cursor can be moved to the bottom left corner and, like most applications, this can be used to drag the panel to a more suitable size as a temporary change.

Although there are preferences and controls for windows there (see below), oddly Apple has an Inspector (a Shell menu item, or Command + i) and in "Info" the size of the window may be set. I work with 160 x 55 on my MacBook Pro 15" which gives me a large enough display for most purposes.


Terminal


The preferences panel has much that will appear arcane to new users. As this article is about making people comfortable with the command line interface, I will make some basic interface suggestions. A rule here (as with many changes): If in doubt, Don't. Nonetheless, some things may be changed safely, particularly with regard to the interface.

White is boring, and when I first started using computers (MS DOS 2.3 and an IBM mainframe that I admit I was lost on) screens were green and characters usually yellow. Some were black with orange characters and there were variations, with a nice two-tone blue on a Zenith portable computer I saw. There are two ways to have these displays back again: using the Startup or the Settings panes in Preferences for Terminal.


Terminal


Startup has a radio button marked "New window with settings:" and the user is offered a selection in a button, with "Basic" as default. Also listed are Grass, Homebrew, Man Page, Novel, Ocean, Pro (my choice), Red Sands, Silver Aerogel and Solid Colors.

If you want to see what these look like, the Settings pane has a small thumbnail of each in a column to the left.


Terminal


In Settings, double-clicking on any of the mini pane Profiles will create a new Terminal panel. The size depends on the "Window Size" settings which are different for each Profile: if I select 160 x 55 for "Man Page", the settings for Ocean will not be the same. Double-clicking on the name of a panel profile will allow the user to change the name, should this be wanted.

As well as the window size, the color may also be changed. So that the default set remains, a gear icon at the bottom allows a duplicate panel to be created. Other controls in the same panel allow use of a background image. To test this out, I used a photograph from the Mae Klong market and in the text panel changed the color of the characters to yellow. Not all images are suitable of course and for normal work I prefer white text on a black background.


Terminal


A Terminal window will display information about the last login and also the name of the computer and account name, followed by a $ sign (other characters may also be used in some cases): this is the command line. The first time terminal is used, it will open in the Home directory.


Simple Commands

To start the ball rolling, users might want to try a simple command. In MS DOS, the command to see a directory listing was DIR. In Unix, this is ls. This will show a straightforward display of folders in the user's home directory.

Unix however, is more flexible than DOS and by adding sub-commands after a space we can change the display. So

ls -l

will list all the folders with additional information about each, while

ls -la

will list all of the folders that exist including those that normally remain invisible.


Typing in the command, clear will remove any information and the command line alone will be shown at the top of the window.

Using the UP arrow on the keyboard will show previous commands (DOWN may also be used). To finish working in Terminal type, exit and press the Enter key.


To be continued. . . .



See also:

  • New Users and Terminal (2) -- Basic Navigation
  • New Users and Terminal (3) -- Shell Basics
  • 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