Thursday, October 18, 2012

How to create a file in /usr/bin in Mac OS X

Recently I started working on Mac Operating system or OS X.  And for setting up GIT on the Mac Server machine, I need to create a file in /usr/bin directory. I login'ed as a root user, still I can't able to create the file.

       I searched in many ways how to create the file/folder in /usr/bin or /usr/local/bin directory, final I got the solution. To create the file/folder we need to run the command with sudo option.

Below is the result with out sudo option. Here we got permission denied error.

:local jrkingism$ touch abc
touch: abc: Permission denied

Below is the result with sudo option. Here we are able to create the file using touch command.

:local jrkingism$ sudo touch abc
:local jrkingism$

So by adding sudo  before the command, we can excecute shell commands at /usr/local/ or /usr/bin/

Popular Posts