17

I've started toying with some Mac development and wonder where the best place to store the code is?

Generally on my windows box, I'd store all my code in c:\Code\

On the Mac it's in /Users/Liam/Code/

Will this cause me any issue with permissions when running web code?

2
  • What does "MAC" stand for?
    – user34530
    Commented Feb 26, 2012 at 23:25
  • 8
    No idea why this has been voted to be closed twice. It's a perfectly legitimate question.
    – LiamB
    Commented Feb 28, 2012 at 9:49

1 Answer 1

19

Your home directory is a great place to store your code on a Mac/Ubuntu (Linux based system).
I would still create sub directories under it as appropriate. I usually organize by project, with a few extra directories for whatever, e.g.

/home/myname/project_pear  
/home/myname/project_pear/upgrade/  
/home/myname/random_java_code  
/home/myname/Dropbox/my_open_source_awesome_project  

The other thing I do which is really "big" for me is to create aliases in .bash_rc (Ubuntu) or .bash_profile (Mac). I have so many now I put them in a separate file called .bash_aliases. (which I keep on Dropbox of course...) and include it with:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

For instance, for the above, I might create a 'mup' alias that does a cd /home/myname/project_pear/upgrade, then I can just type mup at the command line to do that long cd!

Another hint - when you copy working code into a unix based system, you will often find that executable say 'insufficent permission'. However you can frequently fix that with chmod +x filename (modify the file so that is has eXecute permission.

1
  • This is great, thanks for the tip on the Bash_Aliases. I found on a mac if I go - alias code="cd /Users/Liam/Code/" i now map Code straight to my Code directory.
    – LiamB
    Commented Feb 26, 2012 at 20:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.