[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: get pkg name

linux china wrote:

using the dpkg -l to get a list some installed package lists like this,
dpkg -l some-pattern
if the package name is too lang, its name is cut because of the limit
of the columns 80. if I wanna output name and description, what's the
command line?

The Easy Way:

dpkg -l some-pattern | less

Others have mentioned how to get only the name and description as you asked; but I think your intent is really to get the whole name, right? Anything you do that changes the standard output of the command so that it is not writing directly to a terminal will cause it to make all fields as wide as necessary. This includes any redirecting using | or >, so what Douglas Tutty wrote will also work:

dpkg -l some-pattern > op.txt

.. then you may view the file op.txt however you like.

If you want the output directly to your terminal without using less or going through a file, you can just redirect to the cat command:

dpkg -l some-pattern | cat


Reply to: