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

Re: How can I get a listing of ALL installed Packages

Michelle Konzack writes:
>but now a new question:
>MK>  dpkg -l | grep "^.i" >pkgs-installed
>               ^^^^^^^^^^
>What is this with 'grep' ???

'man grep'

       Grep  searches the named input files (or standard input if
       no files are named, or the file name - is given) for lines
       containing a match to the given pattern.  By default, grep
       prints the matching lines.

And the pattern in this case is ^.i which says,

^ only match on the first character of the input
. match any single character after that 
i match the letter "i"

So it will find any lines that have any character in the first column and
the letter i in the second.   Look at the raw output of 'dpkg -l' to 
see what the letter "i" in the second column means.  

Brian Servis
Mechanical Engineering              |  Never criticize anybody until you  
Purdue University                   |  have walked a mile in their shoes,
servis@purdue.edu                   |  because by that time you will be a
http://www.ecn.purdue.edu/~servis   |  mile away and have their shoes.

Reply to: