Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to write a small zsh (bash compatible) script to take each file in ~/.oh-my-zsh/links directory and creates a hard link for it in ~. I am not sure how to do this. Would this be correct?

pushd .; 
cd ~/.oh-my-zsh/links; 
ln * ~/*;


share|improve this question
up vote 2 down vote accepted

No that is not correct. You should run this:

pushd .; 
cd ~/.oh-my-zsh/links; 
ln * ~;

To create a hard link of every file in ~/.oh-my-zsh/links in ~.

share|improve this answer
+1 or do the work in HOME: cd && ln .oh-my-zsh/links/* . && cd - – glenn jackman Aug 11 '12 at 2:05
Or indeed just ln ~/.oh-my-zsh/links/* ~ – Daniel Andersson Aug 11 '12 at 12:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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