Find large files on a Mac using Terminal

Every few days, I had an issue where my startup disk was full and emptying the trash just wasn’t doing enough.

I found the following command online that searches a file system for files over 500MB and prints the file path. It identified files I had totally forgotten about as well as some huge files generated by apps I no longer used.

sudo find / -size +500000 -print

I then used the rm command to delete files. When deleting entire directories I used the recursive flag (be careful!)
rm -rf <directory path>

Kudos to davidcraddock.net

Remove all .svn folders in subdirectory

You may want to copy the contents of one folder to another, but if the original folder is already added to Subversion (SVN) you get an error when committing the new folder.

When a folder is committed to SVN, a .svn folder is added to each folder within the folder subdirectory. To un-add the folder from SVN, you simply remove this .svn folder.

To save time, you can remove all .svn folders within the folder subdirectory by using the following command.
Weiterlesen „Remove all .svn folders in subdirectory“

Mac OSX Shell Script to automate connecting to WiFi network

I have a Mac laptop running ‚Snow Leopard‘ that occasionally will not connect to my home WiFi, even though other devices are connected to the network just fine.

I wrote a small shell script that uses the networksetup command to reset AirPort. If WiFi is still not connected, the script tries to assign the AirPort WiFi network directly. If that doesn’t work, it just resets AirPort again.
Weiterlesen „Mac OSX Shell Script to automate connecting to WiFi network“

Uninstall and Remove Xcode Completely

If you are in a position where you want to remove the colossus that is Xcode, here is the terminal command to use.

sudo /Developer/Library/uninstall-devtools –mode=all

In my case, I was using migration assistant to migrate my applications and user account to a new laptop. My older laptop had an older version of Xcode that I didn’t want included in the migration and as it is so big, I didn’t want to take the chance.

Kudos to Pushkararora.com

Using Terminal Screen Command

This is a simple one. For some reason, every time I use the screen command in terminal, I forget the commands.

There are probably lots of cool reasons to use screen but I use it to run a script over a longish period. The advantage of screen is I can start the script in the screen instance and detach from it. I can close my laptop and return later to my terminal, open my screen and check the progress of the script. Also, you can run multiple instances of a script as each screen has its own process.

So the basic commands I use and tend to forget are… Weiterlesen „Using Terminal Screen Command“