How do I duplicate the permissions of one file to another file from Mac OS shell?

February 18, 2013 in Mac Tips, Recipes, Shell

Like this: chmod `stat -f %A srcFile` dstFile The same command can be used also on folders. Note that the option –reference discussed here will not work on Mac OS.
…read more

What is the recommended shebang line for Python?

November 30, 2012 in Coding, Python, Recipes, Shell

#!/usr/bin/env python

How do I search a set of files and batch process them?

August 11, 2012 in Content Type, Python, Shell, Tutorials

Let’s consider the following scenario. You have a folder containing, amongst the others, a specific subset of files to which you want to apply a command and collect the output
…read more

Where can I find a convenient list of the bash shell keybindings?

July 19, 2012 in Recipes, Shell

Here (http://weblog.topopardo.com/others/bash_cheat_sheet.pdf). Thanks Carlos (http://carlosfenollosa.com/index.en.php)!

How do I get a fully qualified path in Matlab/Octave?

May 29, 2012 in Matlab, Octave, Recipes, Shell

You can use this one line function (tested only on Unix like systems): For example, suppose that the current directory is /Users/zuliani/Documents/Temp. Then: octave:1> fullpath(‘.’) ans = /Users/zuliani/Documents/Temp octave:2> fullpath(‘../../Documents/’)
…read more

How can I access the user’s Library folder on Mac OS X?

May 20, 2012 in Mac Tips, Recipes, Shell

The user’s Library folder is a hidden folder in the home directory. To access it, follow one of these three methods: 1) Open a Finder window, and press Command +
…read more

How do I reload the setting of bash?

January 29, 2012 in Recipes, Shell

Using the command: source ~/.profile You may also include it in your .profile: alias reload=’source ~/.profile’

How can I move one word left or right in the mac OS terminal?

August 4, 2011 in Mac Tips, Recipes, Shell

You need to set up a couple of key bindings. Go to Preferences->Settings->Keyboard pane in your terminal application. Add the following key bindings: option + cursor left to ESC+b option
…read more

How do I search through the bash history?

June 12, 2011 in Recipes, Shell

Using bash type CTRL+r first-letters-of-the-command Note that if you type the command history all the commands that you typed will be displayed, preceded by an index. To recall a command that is
…read more

How do I completely remove Xcode and all the Developer Tools from my Mac?

February 5, 2011 in Coding, Mac Tips, Recipes, Shell, Software

In a shell, type: sudo /Developer/Library/uninstall-devtools –mode=all Then provide your user passsord, and press enter.