FIX: Operation not permitted as root in OS X Terminal

Switch OffWhen running commands in El Capitan OS X terminal, even as root  you may be greated with a rather unhelpful error message of ‘Operation not permitted’. In fact, this isn’t an error message at all – it’s part of an OS X El Capitan feature called System Integrity Protection.

The following is a description from the Apple website:

System Integrity Protection is a security technology in OS X El Capitan that’s designed to help prevent potentially malicious software from modifying protected files and folders on your Mac.

In OS X, the “root” user account previously had no permission restrictions and could access any system folder or application on your Mac. Software gained root-level access when you entered your administrator name and password to install it and could then modify or overwrite any system file or application.

System Integrity Protection restricts the root account and limits the actions that the root user can perform on protected parts of OS X.

Read more

 In order to switch off the System Integrity Protection, you firstly need to boot your Mac from the built in recovery partition, to do this follow the steps below;
  1. Power off your Mac
  2. Press and hold CMD + R on your Mac keyboard
  3. From the Utilities menu, select Terminal
  4. Copy and paste or type in the following:

    csrutil disable
    reboot

Once El Capitan has finished booting back up, you should be able to perform your advanced file manipulation without any more operation not permitted messages.

It is worth bearing in mind, if you leave this switched off you’re leaving your Mac vunerable to accidental or malicious system level file changes, which could result in it needing a complete reinstall or worse. So unless you are a confident advanced user, it would be worth repeating the steps above but replacing disable with enable.

Read More

Show hidden files Mac OS X 10.7, 10.8, 10.9 and 10.10 Yosemite

OS XUnlike Microsoft Windows, by default OS X hides system files from end users. There is a perfectly reasonable explanation for this. Some of the files which are hidden, are important and damaging them could prevent your system from booting all together.

However – on the flip side, there is often a valid reason for needing access to those files. Anything from needing to change a system setting to removing files an unruly application has left behind.

There are several ways to show hidden files in OS X, the easiest would probably be to follow this tutorial on how to build an Automator script. This will give you an icon that you simply have to double-click on to show or hide the files.

Alternatively, if you are just looking for something in your Library folder, did you know that if you click “Go” in the menu bar whilst in Finder, then whilst the menu is expanded click the Alt key on your keyboard the Library menu will appear.

Another method would be to run a command in a terminal window to change the system setting. To do this all you need to do is:

  1. Open Finder
  2. Open the Utilities folder
  3. Open a terminal window
  4. Copy and paste the following line in:
  5. Press return
  6. Enter your administrator password when prompted
  7. Press return

You should find the finder window will disappear, along with the icons on your desktop. However, if you now launch a new finder instance you will now be able to see any hidden files or folders. Once you are done, perform the steps above however, replace the terminal command in step 4 with:

If the above is not working for you, you may want to try switching YES/NO to TRUE/FALSE .. Beware that this is case-sensitive!

If you are experiencing issues using the examples above, please post a comment using the comments system below.

Read More

Stress test your Mac CPU

Terminal

When it comes to diagnosing hardware issues on Apple hardware, sometimes they can be difficult to track down. Especially when the issue only occurs when the Mac is under load.

However, there is a unix command you can use to stress test the CPU from the OS’s Terminal. Although you’re not lightly to find it without knowing it’s there.

The utility called “Yes” is a simple application, which you call from Terminal. Upon executing the command in Terminal your CPU will rapidly race up to 100%

Terminal

To initiate the test, launch a Terminal window, type the following command and press return:

Yes

As soon as the command commences, you will see your terminal window filling with Y’s, this is how it stresses your CPU. Once you are done testing, you can cancel the stress test using Ctrl + C.

The Yes unix app accepts any character or numeric value as a parameter, and outputs it repeatedly into the Terminal window. For example, if you open a terminal window and type:

Yes 4321

The command will output 4321 repeatedly until stopped. So to really test your CPU you could pass:

Yes 84803802380237823783428723487902387423827394

Some Mac’s have been known to suffer with an issue causing them to shutdown after 15 minutes of intensive CPU usage. Should you find your Mac does this when under load using Yes, you may want to get in touch with Apple Tech support.

It can also be used to pipe the parameter to another application, therefore forcing an app which normally requires interaction to run no-interactively. Which makes Yes both a very powerful, and a very dangerous tool.

For example, should you want to delete all the files in the current folder without responding to each prompt you could use this following command:

YES | RM *.*   <- Do not copy/paste this into terminal

The RM command would immediately start removing files of any extension in the directory, using the Yes commands output as confirmation of the delete.

So – as you can imagine, this could be a very dangerous command used in the incorrect way. However, it is a goto command used by the Genius’ bar in Apple stores.

Read More

AirDrop: How to enable on older Mac’s

AirDrop

AirDropWhen Apple first announced the introduction of AirDrop I immediately thought of all the things it was going to help me with transferring. I have been a Mac user for many years now, and often find myself needed to transfer files between macs, it’s not always convenient to use external storage or setup shares. So AirDrop is perfect for the job.

However, Apple didn’t enable airdrop on all hardware.. Which is a bit of a shame.. But wait!! Using this simple terminal command below you can enable AirDrop on most mac’s..

defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool TRUE

Once done, you will need to relaunch finder for the changes to take effect. To do so, copy/paste the following into your Terminal window, and press return:

killall Finder

Once enabled you should find you have a new option in your ‘shortcuts’ in your finder window. Clicking on the ‘AirDrop’ icon will switch on AirDrop and make your mac visible to other airdrop users. AirDrop relies on your Wireless network adapter, so you will be unable to use this to trader documents on a plane….

I have also seen issues trying to airdrop certain file types. So if the file you are trying to transfer is constantly failing it may be that the file type is not actually supported by the airplay protocol.

It’s also not currently possible to AirDrop between OS X and iOS devices. Hopefully this is something that will change in the future. As transferring images using AirDrop from your iPhone and iPads would be great..

If you decide you no longer want AirDrop to be active on your mac, you can simply reverse the changes using the following terminal command:

defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool FALSE

Then, of course, you will need to relaunch finder once again:

killall Finder

If you have problems using this terminal command – get in touch using the comments system below.

You can read more about the Apple AirDrop protocol over on Apple’s website: Mac Basics: AirDrop helps you share items with others nearby

Read More

Free up inactive memory in OS X Mavericks

Mavericks

MavericksOver the last few years OS X has got progressively more intuitive memory management, however – it’s still not completely flawless. This is obvious when using Virtual Machine technologies such as VMWare Fusion, OS X is not overly quick ‘mopping’ up memory once fusion is closed down. Which is where the terminal command PURGE comes in.

The purge command cleans out the memory and disk caches, and by doing a purge you are essentially replicating a system reboot.

To perform a purge, follow the instructions below:

  1. Open Finder
  2. Open the Utilities folder
  3. Open a terminal window
  4. Copy and paste the following line in:
  5. Press return
  6. Enter your admin password
  7. Press return

This one is worth a shot if you’re busy opening/closing applications and you feel performance slipping.

Read More