Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Learning Unix for OS X Mountain Lion
Preface
Who This Book Is For
Who This Book Isn’t For
A Brief History of Unix
Versions of Unix
Interfaces to Unix
How This Book Is Organized
Conventions Used in This Book
Using Code Examples
A Word on OS X Versus Mac OS X
Safari® Books Online
How to Contact Us
The Evolution of This Book
Acknowledgments
1. Why Use Unix?
The Power of Unix
Batch Renames and Extracting File Lists
Finding Hidden Files
Folders or Directories?
Thousands of Free Applications
Power Internet Connections
Commands Included with Unix
Displaying All Unix Commands
The 10 Most Common Unix Commands
A Simple Guided (Unix) Tour
2. Using the Terminal
Launching the Terminal
Syntax of a Unix Command
Exercise: Entering a Few Commands
Types of Commands
Changing the Terminal’s Preferences
Startup
Settings
Features of the Terminal
Secure Keyboard Entry
More cool Terminal features
Customizing Your Terminal Session
Setting the Terminal’s Title
Using AppleScript to Manipulate the Terminal
Working with .terminal Files
Working with the Terminal
The Shell Prompt
Entering a Command
date
who
Recalling Previous Commands
Completing File and Directory Names
Running Multiple Commands on the Command Line
Correcting a Command
Ending Your Session
Problem Checklist
Customizing the Shell Environment
Picking a Login Shell
Changing the Command Prompt
Advanced Shell Customization
Shell Configuration Settings
Creating Aliases
The Unresponsive Terminal
3. Exploring the Filesystem
The OS X Filesystem
Your Home Directory
Your Working Directory
The Directory Tree
Absolute Pathnames
Relative Pathnames
Relative pathnames up
Changing Your Working Directory
pwd
cd
Files in the Directory Tree
Listing Files and Directories
The All-Powerful ls Command
Trying Out the ls Command
Using the -l Option
File Permissions
Calculating File Size and Disk Space
Calculating Available Disk Space
Exercise: Exploring the Filesystem
Protecting and Sharing Files
File Access Permissions
Setting Permissions with chmod
Problem checklist
Changing the Group and Owner
Changing Your Password
Superuser Privileges with sudo
Exploring External Volumes
4. File Management
File and Directory Names
File and Directory Wildcards
Looking Inside Files
cat
less
grep
Creating and Editing Files
Text Editors and Word Processors
The vi Text Editor
vi Basics
Searching in vi
Invoking external Unix commands
More powerful capabilities
A Simpler vi Alternative: Pico
The More Complex Option: Emacs
Managing Files
Creating Directories with mkdir
Copying Files
Problem checklist
Renaming and Moving Files with mv
Removing Files and Directories
rm
rmdir
Working with Links
Compressing and Archiving Files
gzip
tar
Files on Other Operating Systems
5. Finding Files and Information
The Oddly Named grep Command
Useful grep Options
Matching context
Matches in color
Counting matches rather than showing matching lines
Working with Regular Expressions
Finding Files with locate
Building the locate Database
Using locate
Using find to Explore Your Filesystem
Matching by File Size
Exploring find Permission Strings
Using find to Identify Recently Changed Files
find’s Faithful Sidekick: xargs
Further Refinements to find
Shining a Light on Spotlight
Listing Spotlight Metadata with mdls
Finding Files with mdfind
Making Spotlight Useful
6. Redirecting I/O
Standard Input and Standard Output
Putting Text in a File
cat
Pipes and Filters
wc
tr
grep
head and tail
sort
uniq
Piping Output to a Pager
Printing
The Unix Way
lpstat
lp
pr
7. Multitasking
Running a Command in the Background
Checking on a Process
ps
top
Other Options for Monitoring Processes
Canceling a Process
kill
killall
Launching GUI Applications
open
Useful Starting Options for Use with open
Making open More Useful
8. Taking Unix Online
Remote Logins
Web Access
Remote Access to Other Unix Systems
Transferring Files
scp and rcp
FTP
Command-line ftp
sftp: ftp to secure sites
FTP with a web browser
FTP with curl
FTP from the Finder
Other FTP solutions
Easy Shortcuts with New Remote Connection
9. Of Windows and X11
X11
Using X11
Differences Between OS X and X11
Customizing X11
Customizing X11’s Applications menu
GIMP, the X11 Graphics Editor
10. Where to Go from Here
Documentation
The Terminal’s Help Menu
The man Command
Documentation on the Internet
Books
Customizing Your Unix Experience
Shell Aliases and Functions
Programming
Shell scripts
Turning shell scripts into AppleScript droplets
Perl, Python, and Ruby
C and C++
Index
About the Author
Colophon
Copyright
← Prev
Back
Next →
← Prev
Back
Next →