which package a file belongs to

Nils Kassube kassube at gmx.net
Sun Jan 18 11:26:11 UTC 2009

frmas wrote:
> I've tried to optimize that, but I failed. I don't know how to get rid
> of those little ":" at the end of the name. This is my command line :
>  dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
> but awk returns "nedit:" ;-(
> I do not know how to remove those ":".... Francois

How about this?

dpkg -S /usr/bin/nedit|dpkg -l $(cut -f1 -d':')


More information about the ubuntu-users mailing list