New answers tagged version
--last won't tell you the highest version number but it will order by date of installation. So you can see the most recently installed version: [root@xms_apps ~]# rpm -qa kernel-xen --last kernel-xen-2.6.18-348.1.1.el5 Tue 29 Jan 2013 02:18:52 PM EST kernel-xen-2.6.18-308.11.1.el5 Fri 20 Jul 2012 04:00:26 PM EDT ...
You really need to use the RPM library to get a good result. The version comparison algorithm is... decidedly complex. It's non-trivial to reimplement in shell, but if you can use Python to do the actual comparison, it becomes relatively straightforward. See http://stackoverflow.com/questions/3206319/how-do-i-compare-rpm-versions-in-python for an exmaple of ...
TL;DR The 3rd attempt actually works! I'm leaving the first 2 attempts so that others that may come across this Q&A in the future will hopefully gain some insight into how non-trivial a problem it is to parse RPM version information and determine the lineage of which came first, second, etc. Attempt #1 (OP said didn't work) This command will sort the ...
It means that they'll keep backporting fixes to it for a while, but no new development/enhancement goes into it.
Check What does "stable/EOL" and "longterm" mean? @ https://www.kernel.org/category/faq.html
All shells traverse the directories in the $PATH in order, and execute the first command they find. For example, if your path is /usr/local/bin:/usr/bin:/bin, then the command from /usr/local/bin is executed if there is one; if there isn't, the command from /usr/bin is executed, and so on. It doesn't matter in which order the commands were installed. ...
In Solaris, there are typically two directories (actually more than two) that contain different versions of the same name program. An example is ps which is found in /usr/ucb and /usr/bin. If both /usr/ucb and /usr/bin appear in your PATH, the version of ps that gets executed is whichever one appears first in your PATH.
In general it will be the order it is found in $PATH since that is the intended usage for $PATH. There could be an exception to this rule but that would require that the command is hard coded with a directory to the command in the software. I would consider that bad practice though.
You can't have two files with the same name in the same directory. If there are several versions of prog, you have one e.g. in /usr/bin and another one in /usr/local/bin, and the PATH environment variable decides which one is picked. This is done by one of the exec(3) family which looks at the PATH (most probably execvp(3)), the shell has no saying here.
Top 50 recent answers are included