|
From: | Hans J Albertsson |
Subject: | Re: how to search for commands |
Date: | Tue, 24 Feb 2015 11:54:56 +0100 |
Help in bash seems to do most of what's actually needed.
Hans J. Albertsson
>From my Nexus 5
Powershell is a very good cmd language, so bash and other unix shells might do well to adopt some ideas from there.
Normally, cmd search is only done thru completion in Unix shells, which was an idea from tops 20 exec on Digital Equipment mainframes and early lisp machines.
Get-command does more than lexical completion, I think.Hans J. Albertsson
>From my Nexus 5Den 24 feb 2015 06:11 skrev "Dan Douglas" <ormaaj@gmail.com>:On Mon, Feb 23, 2015 at 10:50 PM, <garegin16@gmail.com> wrote:
> How do you search for commands? In powershell you have the get-command cmdlet. Is there anything equivalent in unix?
Depends on the type of command. For shell builtins, bash has `help':
$ help '*ad'
Shell commands matching keyword `*ad'
read: read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N
nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
Read a line from the standard input and split it into fields.
...
To search for commands found in PATH (or functions or aliases) use
`type'. See `help type' for how to use it.
Searching for commands by package is OS-specific. e.g. in Gentoo
`equery f -f cmd pkg' will show "commands" belonging to a package.
Cygwin's equivalent is `cygcheck -l'. Pretty much every distro has
something similar.
--
Dan Douglas
[Prev in Thread] | Current Thread | [Next in Thread] |