Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2015 09:23:19 +0000
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org
Cc:        Manish Jain <bourne.identity@hotmail.com>
Subject:   Re: Setting up an alias for 'pkg info | awk'
Message-ID:  <2144033.K6Q1fOgUqN@curlew.lan>
In-Reply-To: <BLU437-SMTP5127A51A909BBF868937B4F64C0@phx.gbl>
References:  <mailman.60.1421409601.72162.freebsd-questions@freebsd.org> <BLU436-SMTP220A1C5AFBDA897CC34F219F64F0@phx.gbl> <BLU437-SMTP5127A51A909BBF868937B4F64C0@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 17 Jan 2015 14:29:22 Manish Jain wrote:
> I am trying to list out all the ports on my system with a Bash shell alias :
> 
> alias pia="pkg info | awk '{print $1}'"
> 
> But this alias simply prints the output of 'pkg info'.
> 
> Is there some way to do this ?

Assuming that you're just wanting to get a list of the names of all your 
packages you could use:

pkg query -a '%n-%v'		# for the full names

pkg query -a %n			# for just the names without version numbers

pkg query -a %o			# for the origins in /usr/ports


-- 
Mike Clarke



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2144033.K6Q1fOgUqN>