You are not logged in.

#1 2018-06-22 13:27:50

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

[SOLVED] How to use pacman "-F" option to search file paths

If I issue the following command (after refreshing the files database: "pacman -Fy"):

pacman -Fsx 'bin/bash'

I get no result, it seems that I can search on file names but not on files path. Is that normal? Can I search on file paths? The pkgfile command (that I thought was rendered obsolete by the -F option of pacman), seems to work as expected:

pkgfile -srv 'bin/bash'

output the expected result.

Last edited by olive (2018-06-23 05:41:11)

Offline

#2 2018-06-22 22:06:09

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED] How to use pacman "-F" option to search file paths

Pacman man page wrote:
FILE OPTIONS (APPLY TO -F)
       -s, --search
           Search package file names for matching strings.

This seems to be the intended behavior. You can ask the devs about adding an option to search for full paths via the pacman-dev mailing list.

Note that you can grep the output of pacman -Fl as a workaround:

$ pacman -Fl | grep -e bin/bash
bash usr/bin/bash
bash usr/bin/bashbug
bashburn usr/bin/bashburn
bashrun usr/bin/bashrun
ejabberd usr/lib/eredis-1.0.8/ebin/basho_bench_driver_eredis.beam
ejabberd usr/lib/eredis-1.0.8/ebin/basho_bench_driver_erldis.beam
jake usr/lib/node_modules/jake/bin/bash_completion.sh

My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2018-06-23 05:40:53

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [SOLVED] How to use pacman "-F" option to search file paths

Thanks! I simply (stupid me) didn't notice the "-Fl" option that do what I want together with grep.

Offline

#4 2018-06-23 11:13:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] How to use pacman "-F" option to search file paths

If you know the *full* path you can use -Fo, but also if you want a much faster search of partial path including the filename, you could do something like this:

pacman -Fl $(pacman -Fsq bash) | grep bin/bash

Of course if you are only looking within the local database this is even much much faster:

grep -F bin/bash /var/lib/pacman/local/*/files

Last edited by Trilby (2018-06-23 11:23:06)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2018-06-24 03:20:48

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] How to use pacman "-F" option to search file paths

Yeah... this is why I prefer the more powerful functionality offered by pkgfile, which is not in fact deprecated or rendered obsolete just because pacman -F offers a limited emulation built into pacman itself.

Use pkgfile. Not only does it have more functionality and options, it's also faster. tongue


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB