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.

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

1 Answer

up vote 2 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.

link|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
feedback

Your Answer

 
or
required, but never shown

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