• Complain

Barrett - Macintosh Terminal Pocket Guide

Here you can read online Barrett - Macintosh Terminal Pocket Guide full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Beijing;Sebastopol;Calif, year: 2012, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Barrett Macintosh Terminal Pocket Guide
  • Book:
    Macintosh Terminal Pocket Guide
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2012
  • City:
    Beijing;Sebastopol;Calif
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Macintosh Terminal Pocket Guide: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Macintosh Terminal Pocket Guide" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Unlock the secrets of the Terminal and discover how this powerful tool solves problems the Finder cant handle. With this handy guide, youll learn commands for a variety of tasks, such as killing programs that refuse to quit, renaming a large batch of files in seconds, or running jobs in the background while you do other work--Page 4 of cover.

Macintosh Terminal Pocket Guide — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Macintosh Terminal Pocket Guide" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Macintosh Terminal Pocket Guide
Daniel J. Barrett
Published by OReilly Media

Beijing Cambridge Farnham Kln Sebastopol Tokyo SPECIAL OFFER Upgrade this - photo 1

Beijing Cambridge Farnham Kln Sebastopol Tokyo

SPECIAL OFFER: Upgrade this ebook with OReilly

for more information on this offer!

Please note that upgrade offers are not available from sample content.

Chapter 1. The Macintosh Terminal

Welcome to the Macintoshs best-kept secret: the Terminal! If youve ever browsed the Utilities folder, youve probably seen this icon:

Macintosh Terminal Pocket Guide - image 2

Maybe youve even launched the Terminal and seen a plain, dull-looking window appear, displaying mysterious words:

But if youre like most users this is probably as far as youve explored And - photo 3

But if youre like most users, this is probably as far as youve explored. And that is a shame, because the Terminal is one of the most powerful programs for controlling your Mac.

What is the Terminal? What does it do? And why should you care? Lets answer the last question by telling a few stories:

  • Youre running Microsoft Word for the Mac when its window suddenly freezes. You type, but nothing happens. You try to quit Word, but it doesnt respond. In desperation, you go to the application dock, select the Word icon, and choose Force Quit. Even this has no effect! You are stuck and have no choice but to reboot your Mac.

  • You have a folder of 1,000 PDF files named file1, file2, file3, and so on. For compatibility with a coworkers computer, you need to rename these files to have .pdf extensions. The Finder doesnt seem to have any way to perform these renames in bulk, so you do them one file at a time (click, click, click) until your hands cramp.

  • Last week, you copied a huge folder of files (and all its subfolders, 10 levels deep) from your Mac to a server on your network. The transfer took over an hour. During the next few days, you modified a few dozen of the original files, and now you want to copy the changed files to the remote server. Of course, you dont want to copy the entire folder again and wait a whole hour! You want to copy just the files that have changed. Unfortunately, you didnt keep track of which ones you modified, so you hunt them down and copy them one by onewhich ends up taking even longer than an hour.

Do these stories sound familiar? In each case, there seems to be no simple solution using the Mac Finder, and you wind up wasting time: rebooting, clicking icons one by one, or hunting through large folders by hand. Well, we have good news. These problems are all easily solved by typing and running commands in the Terminal. In fact, here are the commands that solve our three problems:

killall -KILL 'Microsoft Word' Terminate Word for i in file*; do mv $i $i.pdf; done Rename your PDFs rsync -aE myfolder server: Copy changed files

These short, somewhat cryptic commands get the job done quickly. The Terminal can save you minutes, hours, or even days of work if you learn the right commands. Thats what this book is all about.

By the way, if youre a system administrator of multiple OS X computers, youre going to love the Terminal. Its command line is outstanding for automating system tasks.

Whats in This Book?

This book is a short guide to the Terminal, not a comprehensive reference . We cover important, useful aspects of the Terminal (and its partner, the shell) so you can work productively. We do not, however, present every single command and every last option (our apologies if your favorite was omitted), nor delve into detail about OS X internals. Short, sweet, and essential, thats our motto.

We focus on commands, the words typed on a command line to tell your Macintosh what to do. Heres an example command that counts lines of text in a file, myfile:

wc -l myfile

Well cover the most important commands for the average user, such as ls (list files), grep (search for text in a file), kill (terminate programs), and df (measure free disk space), plus some advanced commands like dscl (manage users and groups) and launchctl (run services and scheduled jobs). We assume you are already familiar with the Mac desktop and the Finder.

Weve organized the material by function to provide a concise learning path. For example, to help you view the contents of a file, we introduce all file-viewing commands together: cat for short text files, less for longer ones, od for binary files, and so on. Then we explain each command in turn, briefly presenting its common uses and options.

At press time, the current version of OS X is Lion (10.7).

Whats the Terminal?

The Terminal is an application that runs commands. If youre familiar with DOS command lines on Microsoft Windows, the Terminal is somewhat similar (but much more powerful).

Inside each Terminal window, there is a special program running called a shell. The shell does four simple things:

  1. It displays a prompt in the Terminal window, waiting for you to type a command and press Enter.

  2. It reads your command and interprets any special symbols you typed.

  3. It runs the command , automatically locating any necessary programs.

  4. It prints the output , if any, in the Terminal window.

The Terminals job is merely to open windows and manage shells. Using the Terminal, you can resize the windows, change their colors and fonts, and perform copy and paste operations. But its the shell that is doing the real work of reading and running commands. shows how the Terminal and the shell work together: when you peer into a Terminal window, you are viewing a shell, which in turn interacts with your Macintosh.

Figure 1-1 Viewing OS X through the Terminal and the shell Whats a Command - photo 4

Figure 1-1. Viewing OS X through the Terminal and the shell

Whats a Command?

OS X comes with over 1,000 commands for file manipulation, text editing, printing, mathematics, computer programming, typesetting, networkingyou name it. A typical command is run in a shell by typing its program name, followed by options and arguments, like this:

wc -l myfile

The program name (wc, the word count program) refers to a program somewhere on your Mac that the shell will locate and run. Options, which usually begin with a dash, affect the behavior of the program. In the preceding command, the -l option tells wc to count lines and not words. The argument myfile specifies the file that wc should read and process.

Case Sensitivity

The commands in this book should be entered exactly, using the same capital (uppercase) and small (lowercase) letters we provide.In other words, commands are case-sensitive. If a command is wc -l (small L) but you type wc -L (capital L), it will not work.

In some situations, capital and small letters are equivalent. Specifically, the names of files and folders are case-insensitive, so when they appear on a command line, you can use capital or small letters as you see fit. Nevertheless, the rest of the command line is case-sensitive, so we recommend not changing the case of any letters in the presented commands.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Macintosh Terminal Pocket Guide»

Look at similar books to Macintosh Terminal Pocket Guide. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Macintosh Terminal Pocket Guide»

Discussion, reviews of the book Macintosh Terminal Pocket Guide and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.