The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
32 views

'which' reports one thing, actual command is another [duplicate]

I am running Ubuntu 12.04, which came with Cmake v 2.8.7. I had need for a more current CMake, so I downloaded the source for 12.8.12.1, built, and installed it per directions. The last step, make ...
5
votes
4answers
132 views

How do I use which(1) with the system's default $PATH?

I would like to use which with the system's default path, ignoring any embellishments from the user's shell configuration files. Motivation I am attempting to write a script to find the system's ...
4
votes
2answers
182 views

xdg-open is installed yet also is not installed

$ xdg-open The program 'xdg-open' is currently not installed. You can install it by typing: sudo apt-get install xdg-utils $ sudo apt-get install xdg-utils Reading package lists... Done Building ...
1
vote
1answer
87 views

Find where a bash command is defined or sourced from? [duplicate]

Sometimes I want to know what a command I type into bash actually evaluates to. Usually I can figure out the location of the executable very easily with which. $ which vim /usr/bin/vim But what if ...
2
votes
1answer
28 views

Missing 'which' executable on CentOS

We booted up our CentOS (6.4 Final, kernel version 2.6.32.... i686) VM today (running on a Windows machine, yeah I know...) and for some bizarre reason the 'which' binary has gone missing. (Last week, ...
55
votes
3answers
4k views

Why not use “which”? What to use then?

When looking for the path to an executable or checking what would happen would you enter a command name in a Unix shell, there's a plethora of different utilities (which, type, command, whence, where, ...
4
votes
5answers
134 views

How to return the directory of a given executable?

If I want to return the path of a given executable, I can run: which mysql Which returns for example: /usr/bin/mysql I'd like to return only: /usr/bin How can I do that?
3
votes
2answers
62 views

How do I know which library and man page will be found first?

With binaries, I can always do which foo to know which binary I am invoking with $ foo, but what about man pages? Is there a way to know the path of the man page will be loaded by default? Similarly, ...
5
votes
2answers
185 views

What does which's --tty-only option do?

I just realized that my sysadmin has created a global alias for which: alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' The which manpage just says: Stop ...
8
votes
4answers
282 views

Why does the “which” command give duplicate results?

which -a ruby gives me /usr/ruby /usr/ruby /usr/ruby It gives the same path three times. Why does this happen?
8
votes
1answer
399 views

What is the difference between which and where

What is the difference between where and which shell commands? Here are some examples ~ where cc /usr/bin/cc /usr/bin/cc ~ which cc /usr/bin/cc and ~ which which which='alias | ...
1
vote
3answers
405 views

Providing the full path doesn't work but calling just the name of the program does, why?

What am I missing? I can call "rvm" from the command line but not reference the entire path that which rvm says I'm using. Not that it's important, but I stay logged in as "jenkins" the entire time ...
7
votes
3answers
637 views

My `which` command may be wrong (sometimes)?

I've compiled the last emacs version from the source code (v24.2) because the version installed on my machine is (quite) old for me (v21.3). I've done the usual: $configure --prefix=$HOME make make ...
1
vote
1answer
232 views

Why `which tmux` and `sudo which tmux` return 2 different values?

ssh bobby@tony:~$ which tmux /usr/bin/tmux ssh bobby@tony:~$ sudo which tmux ...
6
votes
2answers
196 views

Output of which command used for input to cd

I would like to take the output of a which command, and cd to the parent directory. For example, say I have the following: which someprogram With output: /home/me/somedirectory/someprogram And I ...
3
votes
2answers
6k views

How to add home directory path to be discovered by Unix which command?

I have installed node.js at custom location and added the location to the $PATH in .profile file. Hoons-MacBook-Air:npm Eonil$ node --version v0.6.2 Hoons-MacBook-Air:npm Eonil$ which node ...
1
vote
2answers
64 views

Switch between two installs of one program

I have two copies of svn on my machine. /usr/local/bin/svn /opt/subversion/bin When I run which svn it states the first is running how can I switch it to the second?
1
vote
3answers
514 views

How to determine which executable on my path will be run?

I run which and get the following, brendan$ which python /opt/local/bin/python brendan$ which -a python /opt/local/bin/python /usr/bin/python brendan$ ls -l /opt/local/bin/python lrwxr-xr-x ...
7
votes
1answer
468 views

What is the best way to detect (from a script) whether software is installed?

I've been frustrated before with differences in output from the which command across different platforms (Linux vs. Solaris vx. OS X), with different shells possibly playing into the matter as well. ...
0
votes
1answer
201 views

which and find not working to locate ruby.exe path

From the home directory which ruby.exe & find ruby.exe return "no such file or directory" However, I'm able to execute .rb programs in rubymine.
4
votes
2answers
569 views

What does '//' mean in return from `which`

I have an executable script test under the full path /home/sawa/foo/bar/test. The directory /home/sawa/foo/bar is within $PATH, and has priority over the default ones including /usr/bin. When I do ...
0
votes
1answer
140 views

“which” command difference

What is the difference between (unix-system “which [name]) and which [name] commands. For example when I use the (unix-system “which visual_elite) command I get the following result: ...
4
votes
1answer
3k views

How do I get which to show aliases? [duplicate]

Possible Duplicate: How to use which on an aliased command? I'm used to working on systems where which would list aliases, so e.g. if I have an alias like this: alias ...
31
votes
3answers
3k views

How to use `which` on an aliased command?

Like most users, I have a bunch of aliases set up to give a default set of flags for frequently used programs. For instance, alias vim='vim -X' alias grep='grep -E' alias ls='ls -G' The problem is ...