I am wondering if there is a Linux command that allows for the use of wildcards when using the whereis command. For example, whereis vi produces only where vi resides whereis vi* would also show vim if this was a possible command |
The following command should do what you're requesting.
Thanks for the tip.
(27 May '10, 17:53)
Andy
This is what ended up working for me: find
(27 May '10, 17:54)
Andy
This script can be done without any need for pipes to other commands:
(01 Jun '10, 04:50)
SiegeX
|
user@shell:$ find -name vi* This may suite your needs, but realize it won't JUST find vi and vim, but ANYTHING that has vi* in it's name. Of course doing this below, will have different results: user@shell:$ find -name *vi or user@shell:$ find -name vi* |
Normally, you can pipe the output of one command through grep.
But because whereis will only return one value, it's really poinless, so you can also try the locate command like so:
and maybe filter it so you are only lokking in user/bin or usr/local/bin??? Or better still, maybe use the find command above and look only for strings that are in user/bin or usr/local/bin. |
The If you execute
it will show you lots of documentation files, config files and executables of If the output is too large, Here's a link to the man page of locate and a German explanation for locate. Good luck. |
Hello, You could also try "apropos". It does a grep on the manpage database. In your case that would return any page including the text "vi" which would include "vim". Good Luck Thank you for introducing me to apropos!
(27 May '10, 17:49)
Andy
|
john@john-laptop ~ $ whereis vi vi: /usr/bin/vi /usr/share/man/man1/vi.1.gz john@john-laptop ~ $ whereis vi* virtualbox-3.1_3.1.8-61349~Ubuntu~karmic_i386 (1): virtualbox-3.1_3.1.8-61349~Ubuntu~karmic_i386: john@john-laptop ~ $ Whereis works exactly the way you want it. Wildcards are always available in BASH I am using bash but this is my output: root@aws-c3:~# whereis vi vi: root@aws-c3:~# whereis vi vi: /usr/bin/vi /usr/share/man/man1/vi.1.gz root@aws-c3:~#
(27 May '10, 17:47)
Andy
Why doesn't the original vi show up on whereis vi* ?
(03 Aug '10, 17:53)
Andy
|