Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I have a few utility scripts in my ~/scripts folder. They are all bash scripts, nothing amazing about that. One is named sfind.sh, the other is svn-add-all.sh. At some point, I created symlinks to them, and made them executable. So I can run sfind.sh at my prompt as $ sfind and svn-add-all.sh as $ addall.

The problem is, I cannot remember where I put my symlinks. They have to be on my $PATH, but doing an ls on the folders in my $PATH hasn't shown anything.

echo $PATH /usr/local/bin:/usr/local/drush:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

So then I tried doing a system-wide find. Here's what I tried:

sudo find / -lname /Users/kyle/scripts/\* -exec ls --color=always {} \;
sudo find / -mount -lname /Users/kyle/scripts/\* -exec ls --color=always {} \;
sudo find / -name "sfind"
sudo find / -lname "sfind"
sudo find / -name "sfind*" -type fl
sudo find / -name "addall"

And still I got nothing.

Using locate and which hasn't worked either. Obviously these links must be available from somewhere.

Is there any way I can find the location of these symlinks?

Thanks.

share|improve this question
    
Perhaps did you create shell functions, not symlinks. What says type sfind ? –  jlliagre Jun 17 '11 at 13:37

1 Answer 1

up vote 3 down vote accepted

Use

type -a sfind

since type (in contrast to which) will also find functions and aliases you might have defined in your .bashrc or elsewhere.

share|improve this answer
    
I totally didn't think to look in my .bashrc. I work across 3 machines, and the one with the problem gets the least love. Maybe I outsmarted myself. I'll check back. –  KyleWpppd Jun 17 '11 at 17:41
    
It was in my .bash_aliases file. Thanks. I have them symlinked on my other machines. It was driving me crazy. –  KyleWpppd Jun 20 '11 at 18:34

Your Answer

 
discard

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.