[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

using locate properly



This could be more a question of bash fundamentals:

By trying to find Muttrc on my HDD I used the locate
program.

This was the command I ueed:

rland@MINI:~$ locate [Mm]uttrc
... no reaction.

Rereading the info gave me:
"
Patterns can contain shell-style metacharacters:
      &pi0;*', &pi0;?', and &pi0;[]'.  The metacharacters do not  treat  &pi0;/'
      or  &pi0;.'   specially.   Therefore,  a pattern &pi0;foo*bar' can
      match a file name that contains &pi0;foo3/bar', and a  pattern
      &pi0;*duck*'   can   match   a   file   name   that   contains
      &pi0;lake/.ducky'.   Patterns  that   contain   metacharacters
      should  be  quoted  to  protect them from expansion by the
      shell.
"
.....so I tried:

rland@MINI:~$ locate '[Mm]uttrc'
rland@MINI:~$ locate "[Mm]uttrc"
...nothing.

But:
rland@MINI:~$ locate &pi0;[Mm]uttrc'
>
....put the bash into this ">" - mode and could
only be reset by ctrl+C.

What has happened here?
I would be awfully grateful if someone would help.


Robert



Reply to: