If you find the OS X Terminal’s lack of color hard on the eyes, here’s how to set the colors. To get this color scheme, open ~/.bash_profile and add this: export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced export PS1=”\[\033[36m\]\u\[\033[m\]\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\$ ” alias ls=’ls -GFh’ The first line enables colors, the second sets the colors for ls and the last […]
If you use the OS X terminal, you are probably familiar with the open command. Essentially, it opens the given file with the default application, or with the application specified with the -a parameter. For example, open hello.txt will open hello.txt using TextEdit or your default text editor. You can also use this command to […]
When you run a command in the terminal, and realize it requires superuser permissions, use the following command to re-run the command as superuser: sudo !! Here is an example scenario: apt-get install myapplication (permission denied) sudo !! The best part is that you can use this to prefix your command with anything. In the […]
For a reason or another, you might one to change your crontab’s location. For instance, you might want to move it under a version-controlled directory or keep it under your backed up directories. When I reinstalled my home server, I’ve put all of my essential scripts under a directory on another partition to make distro […]
If you are looking to find a git commit by its message, use the following command: git log -S”facebook” This will return all commits with “facebook” in the message.
Here’s a simple trick that lets you launch the Windows Phone 8 Emulator without using Visual Studio 2012. It’s quite simple: Open “Command Prompt” in Administrator mode (right click on it on the Start page icon, choose Run as administrator) Launch the emulator using the following command (with quotes): “C:\Program Files (x86)\Microsoft XDE\8.0\xde” -vhd “C:\Program […]
If you are like me, you might get distracted while waiting for your unit tests to complete, and only return to your IDE several minutes later. On OS X, there is a nifty say command that makes your Mac say anything you want using text-to-speech. By appending it at the end of a long-running command, […]
If you are using grep, you might want to give your results a little context and see lines before and after. The -C argument lets you specify the number of lines to show before and after the result. For instance, grep my_string my_file.txt -C 2 will show two lines before and two lines after your […]