From owner-freebsd-questions@FreeBSD.ORG Mon Apr 6 13:04:53 2009 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B11D010656E8 for ; Mon, 6 Apr 2009 13:04:53 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 296E58FC1A for ; Mon, 6 Apr 2009 13:04:52 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id n36D4PTG043502; Mon, 6 Apr 2009 15:04:48 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id n36D4NMW043501; Mon, 6 Apr 2009 15:04:23 +0200 (CEST) (envelope-from olli) Date: Mon, 6 Apr 2009 15:04:23 +0200 (CEST) Message-Id: <200904061304.n36D4NMW043501@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, peter@boosten.org, Paul Schmehl , Peter Wang , illoai@gmail.com In-Reply-To: <08809CCC-DED8-43E6-B970-8E6A7F158540@boosten.org> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 06 Apr 2009 15:04:49 +0200 (CEST) Cc: Subject: Re: How to find out which ports contains a specified command. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.ORG, peter@boosten.org, Paul Schmehl , Peter Wang , illoai@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 13:04:54 -0000 Peter Boosten wrote: > Paul Schmehl wrote: > > illoai@gmail.com wrote: > > > Peter Wang wrote: > > > > for example, after i installed pfsense, which is based on freebsd > > > > release 7.1, i found adduser command is missing. > > > > > > > > so how to find out which ports contains `adduser' command? > > > > thanks for your replies. > > > > > > % which adduser > > > /usr/sbin/adduser > > > > > > Thus it is part of the base system, installed through /usr/src > > > rather than /usr/ports. > > > > > > Also, as you are running (essentially) 7.x, this is probably > > > better on freebsd-questions than current. > > > > I think you misunderstood his question. > > > > This would be one way to do it: > > > > find /usr/ports/ -type f -exec grep -sq adduser {} \; -print That is horribly inefficient because it forks a separate grep process for every single file under /usr/ports. Also it will print a lot of false positive, because the ports tree contains several files and scripts that call adduser. > How about man pkg_info > > From memory: pkg_info -W /usr/sbin/adduser That won't work, because pkg_info only reports information about packages that you have installed. One way to find which ports provide a certain file is to use the "porgle" search engine: http://www.secnetix.de/tools/porgle/?w=p&q=adduser However, there is an adduser command in /usr/sbin which is part of the FreeBSD base system. If some script complains about that command being missing, you should invstigate whether you do have that command in /usr/sbin. It's unlikely that a port requires a different command with the same name without having a dependency on the port that provides that command. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd C++: "an octopus made by nailing extra legs onto a dog" -- Steve Taylor, 1998