Sunday, May 5, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 375  / 3 Years ago, thu, october 21, 2021, 4:02:20

Sorry, this question is going to be total newb factor. How do I search within a particular directory using the locate command?



The following command isn't working for me:



# locate -i mnt/external/Songs/"tangerine"


I would like to search within the "Songs" folder.


More From » command-line

 Answers
5

Maybe you want



locate -ir 'mnt/external/Songs/.*tangerine'


-r is for regular expressions search, like in grep. You may also use plain globs for situations as simple as this:



locate /mnt/external/Songs/*tangerine*

[#43504] Friday, October 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ligdesig

Total Points: 164
Total Questions: 106
Total Answers: 114

Location: Japan
Member since Sat, Jun 6, 2020
4 Years ago
;