You are not logged in.

#1 2017-11-07 07:25:42

n-tchen
Member
Registered: 2017-03-07
Posts: 17

[SOLVED] Filter pacman output on the basis of a file extension

Hello everybody,

I have a simple question where I wasn't able to find an working answer. I want to filter an pacman output for .desktop files, like e.g.

pacman -Ql mathematica

I tried a couple of different version (with some options) like

pacman -Ql mathematica | grep ".desktop"

but best case it output also every file which has "desktop" in its path - but i only want the files with an .desktop extension. Maybe someone can help me?

Thanks in advance
Markus

Last edited by n-tchen (2017-11-07 13:47:05)

Offline

#2 2017-11-07 07:34:17

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: [SOLVED] Filter pacman output on the basis of a file extension

pacman -Ql | grep "\.desktop$"

Offline

#3 2017-11-07 07:36:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Filter pacman output on the basis of a file extension

grep -E "*.desktop"

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2017-11-07 13:44:16

n-tchen
Member
Registered: 2017-03-07
Posts: 17

Re: [SOLVED] Filter pacman output on the basis of a file extension

Thanks for your fast replys. Allan's version works as I wanted it. Thank you very much!

I tried jasonwryan's version already beforehands - this variant also gave me all files with "desktop" in the path, not only those with .desktop as extension. But thanks anyway!

Markus

PS: Can I set the topic to answered, or does a mod need to do that?
PPS: I think i got it - I just added [SOLVED] to the topic

Last edited by n-tchen (2017-11-07 13:47:52)

Offline

Board footer

Powered by FluxBB