Macintosh Tricks

OS/X

Startup Keys for crashes & repairs:

C -- Boot from the internal optical drive that has a system folder
Option -- Boot into Open Firmware to select a boot device
Command-Option-P-R Reset Parameter RAM (PRAM) and non-volatile RAM (NVRAM)

(mouse button) Eject (internal) removable media
Command-Option-Shift-Delete -- Bypass internal harddrive on boot
Press X during startup Force Mac OS X startup

Command-S Boot into Single User Mode
Command-V Boot using "Verbose" mode (shows all kernel and startup console messages)
X Reset startup disk selection and boot into Mac OS X Server
Shift Boot into "Safe Boot" mode, which runs Disk First Aid. A reboot will be required afterward
T Boot into Firewire target disk mode
N Start from the Network (NetBoot)

Backup with Rsync to a backup hard disk

#!/bin/csh
rsync -r -u -v /SourceDirectory/* /Volumes/Backup/DestinationDirectory
rsync -r -u -v /Users/UsernameDirectory/* /Volumes/Backup/UsernameDirectory

A more detailed example

The Mac OS X Screen Capture
Start the terminal window from the applications/utilitiesfound in the application folder via the finder then type:
screencapture -ic
The option '-c' forces the screen capture to go to the clipboard. The interactive lets you choose the part of the screen to capture
To capture the whole screen to the given file try:
screencapture ~/Pictures/sc2.pdf
To activate interactive mode use the -i parameter: lets you choose the part of the screen to capture - This is extremely useful!
screencapture -i ~/Pictures/sc2.pdf
control key - causes screen shot to go to clipboard
space key - toggle between mouse and window selection modes
escape key - cancels interactive screen shot

find . -type f | xargs grep -l 'Unchanged' | \
xargs sed -i '' -e 's/Unchanged/changed/g'

sed -i does not work in OpenBSD, but apparently it is supported in MAC BSD

Repair Permissions on the hard disk:
Applications > Utilties / disk utilities
then click verify disk permissions
then if needed, click repair disk permissions

Delete unecessary strartup items:
System Preferences > Startup tab > delete useless stuff

BSD Unix tricks for via the OS/X terminal program:
(remember sudo comands require admin password)

Run Prescheduled Maintenence:
From the terminal window:
sudo periodic daily
sudo periodic weekly
sudo periodic monthly

Search the hard disk for files
sudo /usr/libexec/locate.updatedb ---> this updates the filename index
locate "mp3" | grep "music" | sort | more ---> this locates all files with mp3; filters out the ones with music in their file paths; sorts the filtered list and finally the ever popular more command displays the output screen at a time.

Sort a directory via a pipe:
ls -l | sort -n +1
Explained:
ls = list directory -l = use long format
| = pipe output into the next command
sort -n +1 = sort using -n (numbers as opposed to letters) on the +1 (second field)

OS/9 & earlier:
Startup w/o extentions - Hold down shift key while booting
If date is 1904 or something else really stupid zap the PRAM
To Zap PRAM hold down the apple-Option-P-R keys while booting
To rebuild the desktop (advisable after deleting lots of files) hold down the apple-option keys while booting
To boot from CD-ROM:
1) Control Panel/Startup Disk or
2)Hold down "C" key while booting (doesn't always work) or
3)Hold down Shift/Option/Apple/Delete (this actually removes the internal hard drive from the boot sequence.

Return to Jim's Trix Page
Return to Jim's ISER Page

Return to Profiles or Directory Page or ISER Home Page

Last updated January 27, 2005