📅  最后修改于: 2022-03-11 14:50:47.132000             🧑  作者: Mango
Make sure you have locate/updatedb installed (or mlocate/updatedb, or plocate/updatedb).
Assuming you have updatedb set to run in cron on some regular basis...
Type, locate [portion_of_filename]
i.e. # locate bashrc
or
# locate bash_alias
Or, using regular expressions, type locate -r [regex]
i.e. # locate -r bash.*alias
or
# locate -r .*rc
You can also ignore case, type locate -i [-r] [filename]
i.e. # locate -ir xdefaults