3

I'm on Ubuntu 14.04 and I have a shell script or a symbolic link (I can't remember which one - and I'm not sure how to tell what it is) called pbar that runs pianobar. So, to be explicit, from a shell, I can type pbar and pianobar (the program) fires up. I am trying to find the location of this file. I have tried doing the following,

which pbar
ls /usr/bin | grep ^pb
ls /usr/local/bin | grep ^pb

and checked the directory where I store my shell scripts and I think all the other locations on my $PATH. Still I can't track down this file or link - is there some other location / method I should be using? Thanks

  • 1
    Have you tried alias? – DavidPostill Dec 17 '15 at 20:29
  • 1
    Try type pbar or command -v pbar – Eric Renouf Dec 17 '15 at 20:30
  • @DavidPostill omg fantastic, I had no idea of this program, but you are totally right it was aliased, please post as answer if youre inclinded. – pickle rick Dec 17 '15 at 20:30
  • @EricRenouf that also works, sorry guys I am quite ignorant of all the linux commands – pickle rick Dec 17 '15 at 20:31
  • 1
    This highlights a lengthy post on U&L about why not to use which: unix.stackexchange.com/questions/85249/… for all you wanted to know and more about it – Eric Renouf Dec 17 '15 at 20:32
1

Still I can't track down this file or link

One other option to consider is an alias.


alias

Create an alias, aliases allow a string to be substituted for a word when it is used as the first word of a simple command.

...

Without arguments or with the -p option, alias prints the list of aliases on the standard output in a form that allows them to be reused as input.

Source alias


Further Reading

4

A valid helper in bash is type [1]

   type pbar

It will answer if it is an alias, a command, a function or a built in command.

  • yea this is another one I came across in that links, thanks also for the man bash, quite a lot there – pickle rick Dec 17 '15 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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