Issue
I want to use the locate command with regex but i am not able to use it.
I want to find pip
file which is in /usr folder. i am trying this
locate -r "/usr/*pip"
Solution
To use globbing characters in your query you shouldn’t specify regex (as you do with -r
option), so just do:
locate "/usr/*pip"
From the man page:
If –regex is not specified, PATTERNs can contain globbing characters.
If any PATTERN contains no globbing characters, locate behaves as if
the pattern were *PATTERN*.
Answered By – Nelson
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0