OS X tips, tricks, commands, etc

zozo
Posted:
in macOS edited January 2014
Hello everyone, this is a list of stuff (commands, tips, etc) that I have come accross and found useful especially for newbies (and myself). Wanted to post here to share and hopefully get more info to add to it.



Cheers,

ZO





great hints: <a href="http://www.index-site.com/Macosxspeed.html"; target="_blank">http://www.index-site.com/Macosxspeed.html</a>;

also good: <a href="http://www.macosxhints.com/"; target="_blank">http://www.macosxhints.com/</a>;

alot of the following material comes from: <a href="http://new.macfixitforums.com/php/showflat.php?Board=Forum35&Number=166002&pgood"; target="_blank">http://new.macfixitforums.com/php/showflat.php?Board=F orum35&Number=166002&pgood</a> resource for OS X apps: <a href="http://www.aquafiles.com"; target="_blank">www.aquafiles.com</a>



-------------------------------------

Prebinding (optimizing OS X)



go into Application, Utilities, and launch Terminal



sudo update_prebinding -root / (make sure you leave the space between -root and / at the end) You can also copy and paste this command into Terminal.

Optimizes and speeds up your system



sudo redo_prebinding -r /

re-optimizes after an update



-------------------------------------

clean out system logs (speeds up OS X)

sudo sh /etc/daily



su enables root



df gives volume info



top shows all running applications and Process ID (PID) numbers



kill -9 (PID#) Force quits an app in terminal



to get rid of dark squares around icon names type

defaults write NSGlobalDomain Desktop.HasDarkBackground 0



to renable

defaults write NSGlobalDomain Desktop.HasDarkBackground 1



0= false

1=true



command option esc brings up the Application Manager





gets rid of all non english files

find / \\! -name "English.lproj" -name "*.lproj" -type d -exec rm -r -- {} \\;





ls - lists directories

cd - changes directories

cp - copy file

mv - move file

rm - delete file

ln - make links (like aliases)

mkdir - make directory

rmdir - remove directory

pico - basic (easy) text editor

vi - basic (not so easy) text editor

cc - c compiler

man - manual pages



type man followed by any command and get detailed help

type most commands followed -? or -h to get help



I rebooted with command-s keys pressed to do an fsck -y of my OS X/9.1 partition - it found no errors so I proceeded





----------------------------------------

Hi all,



I just found a solution to the 'out of memory' problem when using update_prebinding.



I used the command 'fs_usage' to monitor the disk activity of update_prebinding.

It turned out that there was a file with rather exotic characters in it's filename in my OS 9 Systemfolder. When update_prebinding visited that folder it reread it's contents again and again... until it ran out of memory. I deleted that file, reran update_prebinding and it worked just fine :-)



So here is what I did:

1. open two Terminal Windows

2. become root in both windows using 'su'

3. run 'update_prebinding -verbose -root /' in one window

4. run 'ps aux | grep update_prebinding' in the other

5. look at the line that does _not_ have the word 'grep' in it;

note the number in the second column. This is update_prebinding's process ID. Lets assume it's 208.

6. run 'fs_usage -w 208'

where 208 is of course the process ID you found in step 5.

7. wait until the point you remember update_prebinding stopped to make any progress.

8. Watch the output of fs_usage closely. When it starts to show only blanks where previously filename fragments where shown it's time to...

9. press ctrl-c in both the update_prebinding and the fs_usage window

10. scroll up in the fs_usage window until you see the last file or folder name in the middle column (it may be only a fragment, as fs_usage only displays the last 28 characters)

11. Go to that folder and examine it closely. The file that I had problems with didn't show up in the Finder but in the Terminal using 'ls -la'. Except for some questionmarks in the filename it also contained the String 'Aladdin'....

12. Now comes the tricky part: get rid of the file.

I managed to remove it by using a visual ftp client, logging in on my own machine and hitting delete. I guess there are better ways - but I couldn't explain to Terminal (or 'tcsh' to be precise) what file I wanted to delete. Be careful: the file might be vital to your system. So you might just want to rename it instead. Or not even touch it at all.

But this is for you to decide. Don't blame me!

13. run 'update_prebinding -verbose -root /' again.

----------------------------------------------



I was having the problem of being unable to prebind--- the "optimizing" phase of the system update was choking and even though I read "just let it go" it would go for HOURS with nothing.



Then... FBO came into my life... after hours of frustration. He told me how to find the bad file.



Anyone who's having trouble with an endless binding or a memory error, try this:



1. launch the Terminal.

2. type (quotes are important):

cd "/System Folder"

3. type:

ls -la

4. If you see a file that looks like this:



-rwxrwxrwx 1 root wheel 50428 Dec 25 1999 ??Aladdin Transaction??Info??



then BINGO you found the problem.



Now how do you get rid of the file?



Here's how I did it. This should be old hat to anyone who's deleted an invisible file before in OS 9.





1. Boot off the OS 9 CD-ROM

2. Use a utility like Resourcerer (what I used, maybe Resedit would work. There are probably other tools on versiontracker.com for deleting invisible files) to go into the System Folder.

3. Find that darned file. You won't see the ???? question marks but you will see Aladdin Transaction Info.

4. Un-invisiblize it. In Resourcer you do this by Getting Info for the file and then turning off the bit that makes the file invisible. Sorry i don't have it in front of me.

5. Quit Resourcer or whatever utility you're using.

6. In the finder, grab the file, throw it in the trash.

7. Erase the trash.



Now start OS X up and try doing the prebinding, whether via root as--



update_prebinding -verbose -root /



or using Xoptimize or doing a Software Update.



[ 12-11-2001: Message edited by: ZO ]</p>

Comments

  • Reply 1 of 3
    zozo Posts: 3,117member
    btw, what tools do you find are the best for upkeeping and optimizing OSX?



    (booting from OS 9)

    TechTool Pro 3

    Norton Utilities 6 (Doctor and SpeedDisk)

    DiskWarrior 2.1 (and PlusOptimizer)

    Disk FirstAid



    I tend to use Norton Disk Doctor and TechTool to repair files, etc... then run DiskWarrior, then use SpeedDisk (Norton) to defrag my HD. I tried PlusOptimizer for the first time yesterday... it took 8hours for a 10GB drive. Jesus.



    Suggestions?
  • Reply 2 of 3
    gordygordy Posts: 1,004member
    I downloaded MacJanitor from VersionTracker to take care of the daily, weekly, and monthly UNIX maintenance, since my Macs usually sleep when not being used.
  • Reply 3 of 3
    katekate Posts: 172member
    [quote]Originally posted by ZO:

    <strong>btw, what tools do you find are the best for upkeeping and optimizing OSX?

    I tried PlusOptimizer for the first time yesterday... it took 8hours for a 10GB drive. Jesus.

    </strong><hr></blockquote>



    best tool is the install disk, that lets you erase, reformat and reinstall and reset the passwords.



    In order to avoid long PlusOptimizer sessions, you can copy the entire content of your disk to a second drive delete the original disk and back copy everything. Same effect, but faster.
Sign In or Register to comment.