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
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
To save time, you can remove all
.svn folders within the folder subdirectory by using the following command.
Continue reading “Remove all .svn folders in subdirectory”
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.
Continue reading “Mac OSX Shell Script to automate connecting to WiFi network”
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
Something that has bugged me recently is that when I go to proxy on a particular port, the port is already in use and I get the following error.
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 8090
Could not request local forwarding.
Continue reading “Find process using port number in Bash”
This is a super simple command but there is something about the following sequence of characters that I simply cannot retain in my brain.
Continue reading “Debugging PHP by monitoring errors in terminal”
Excellent post from one of my favourite sites – Become a command line ninja with these time saving shortcuts
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… Continue reading “Using Terminal Screen Command”
Sick of typing out long commands, bad at typing, forget commands from time to time or all 3 like me… then aliases are here to help.
Basically, you can use a handy short memorable alias for a long and possible complicated one in terminal by doing the following.
Continue reading “Terminal Aliases”