This article covers some useful tricks in the Mac OS X terminal. Search for hidden files, Switch between the 32 bit and 64 bit kernel, fixing kernel extensions, enabling NTFS support and more.
- Finding absolutely anything on your Macintosh
- How to tell if you’re running the 32 bit or 64 bit kernel in Mac OS X Snow Leopard
- How to switch between 32-bit and 64-bit kernel mode in Mac OS 10.6
- Delete all files anywhere on your Mac which match a search term
- Working with Kernel Extensions
- Enable NTFS drive support in OSX Snow Leopard or Lion
Finding absolutely anything on your Macintosh
The Spotlight feature doesn't search the Library or hidden locations.
Aside from Spotlight feature, OSX also has a Find feature. Unlike Spotlight you can configure OSX's Find feature (CMD+F) look for system files by performing the following:
- Press CMD+F to open the Find window.
- Towards the left of the window, just above where the search results would appear, you'll a pull-down menu which says (by default)Kind. Click this, and choose Other.
- In the window that opens, scroll down, find, and check off System files.
- Click OK to close the window.
- Now, you can perform searches which will include System files in the results. To do this, select the following criteria for your search:
System files include.
However, even this will not search all files on your Mac (i.e. items in hidden folders). To search all locations for a file, perform the following:
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo find / -name "*Bicycles*"
...where in-place of Bicycles you enter your search term.
- You will be presented with a list of file-paths to any items whose file name contains your search term. The search can take a long time to complete. When the command prompt is displayed again (the same one which initially appeared at the top of the Terminal window when you first opened it), you'll know the search has completed.
How to tell if you’re running the 32 bit or 64 bit kernel in Mac OS X Snow Leopard
Summary
Snow Leopard 10.6 is the first Mac OS X version to ship with a 64 bit kernel. While our Mac has to have a 64 bit processor to utilize that kernel, some 64 bit Macintoshes do not default to using the 64 bit kernel.
Note: Not all applications support the 64 bit kernel. When using applications which only support 32-bit kernel mode, be sure you are running your computer using the 32-bit kernel.
Method 1
- In the upper-left of the screen, select the Apple menu, and choose About this Mac.
- In the window that opens, click the More Info button.
- In the Contents pane on the left-hand side of the window that opens, select Software.
On the right, under System Software Overview, if 64-bit Kernel and Extensions is set to No, you are running a 64-bit kernel.
Method 2
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
uname -a
- If you’re using a 32 bit Kernel in Mac OS X, you'll see:
Darwin iMac.local 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386
If you’re using a 64 bit Kernel in Mac OS X, you'll see:
Darwin iMac.local 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_X86_64 x86_64
How to switch between 32-bit and 64-bit kernel mode in Mac OS 10.6
Summary
Mac OS X v10.6 Snow Leopard includes a 64-bit kernel. On hardware that supports the 64-bit kernel, you can choose whether to start up (boot) your Mac using the new 64-bit kernel or the earlier 32-bit kernel.
Products Affected
Mac OS X Server 10.6, Mac OS X 10.6, Mac Pro (Mid 2010)
Method 1 - Startup key combination (for current startup only)
- If your Mac uses the 32-bit kernel by default, but supports the 64-bit kernel, you can start up using the 64-bit kernel by holding the 6 and 4 keys during startup.
- If your Mac uses the 64-bit kernel by default, you can start up with the 32-bit kernel by holding the 3 and 2 keys during startup.
Note:Your Mac will revert to the default kernel the next time you reboot it.
Method 2 - On-disk setting (persistent)
- To select the 64-bit kernel for the current startup disk, perform the following:
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter
sudo systemsetup -setkernelbootarchitecture x86_64
- Restart your computer.
- To select the 32-bit kernel for the current startup disk, perform the following:
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter
sudo systemsetup -setkernelbootarchitecture i386
- Restart your computer.
Note: This setting is stored in the /Library/Preferences/SystemConfiguration/com.apple.Boot.plist file and will take effect every time you start up from this disk. If you start up from a different disk, the setting on that disk, or the hardware default, will take effect.
Delete all files anywhere on your Mac which match a search term
Be very careful with this one. There's almost no reason you'd need to do this. If you're trying to delete something, you should try any and all of the following first (listed in order):
- If you're deleting an application, just find it, drag it to the trash, and empty the trash.
- Finding the file using Spotlight, the OSX Find Feature, or the method described above. Then delete it yourself.
- AppZapper - Free utility which aids in completely uninstalling programs.
- AppCleaner - Free utility which aids in completely uninstalling programs and can catch files that Appzapper may miss.
- DesInstaller - Simple Macintosh utility for uninstalling device drivers. Be careful not to delete the wrong file(s).
- Leopard Cache Cleaner - Powerful Utility Useful for Installation Problems
If these don't accomplish what you needed, and your problem is serious enough, consider reinstalling your Mac OS, or using Time Machineto revert to a previously saved working state (You are using Time Machine right?).
The main point here is that the procedure below should be used at-your-own-risk, with extreme caution, and as an absolute last resort. Anything deleted using this method is not undo-able. If you delete the wrong file, worst-case-scenario, you could remove a critical system file, preventing your Mac from booting.
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo find / -name "*Bicycles*" –delete
...where in-place of Bicycles you enter your search term.
- Any items whose file name contains your search term will be permanently deleted from your computer. The operation can take a long time to complete. When the command prompt is displayed again (the same one which initially appeared at the top of the Terminal window when you first opened it), you'll know the operation has completed.
Working with Kernel Extensions
Load kext
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo kextload /System/Library/Extensions/Bicycles.kext/
...where in-place of Bicycles you enter the name of the Kernel Extension you'd like to load.
Unload kext
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo kextunload /System/Library/Extensions/Bicycles.kext/
...where in-place of Bicycles you enter the name of the Kernel Extension you'd like to unload.
Troubleshooting kext (Mac OS 10.6.2 and above)
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo kextutil /System/Library/Extensions/Bicycles.kext
...where in-place of Bicycles you enter the name of the Kernel Extension you'd like to look at.
You'll be presented with information on the status of the extension.
Change Ownership of kext
Often, using the troubleshooting step above, you'll find that you have ownership issues with a kext.
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo chown -R root:wheel /System/Library/Extensions/Bicycles.kext
...where in-place of Bicycles you enter the name of the Kernel Extension you'd like to change.
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
sudo chmod -R 755 /System/Library/Extensions/Bicycles.kext
...where in-place of Bicycles you enter the name of the Kernel Extension you'd like to change.
Enable NTFS drive support in OSX Snow Leopard or Lion
- Open Macintosh HD > Applications > Utilities > Terminal
- In the window that opens, type the following, then press Enter:
diskutil info /Volumes/volname
...where volname is the name of the NTFS volume.
- From the output, copy the Volume UUID value to the clipboard.
- Type the following, then press Enter:
sudo nano /etc/fstab - Then Type the following:
UUID=111-111-111 none ntfs rw
...where 111-111-111 is the UUID you copied.
- Save and quit the nano function by typing Ctrl+X, Y, and then Enter.
- Restart your system.
No comments:
Post a Comment