Để tìm kiếm nhanh (nhưng không dứt khoát):
locate -br '^settings.xml$'
Từ man locate:
locate reads one or more databases prepared by updatedb(8) and writes
file names matching at least one of the PATTERNs to standard output,
one per line.
-b, --basename
Match only the base name against the specified patterns. This
is the opposite of --wholename.
-r, --regexp REGEXP
Search for a basic regexp REGEXP. No PATTERNs are allowed if
this option is used, but this option can be specified multiple
times.
Các ^và $đảm bảo rằng chỉ những tập tin có tên settings.xmlvà không phải tập tin có tên chứa settings.xml sẽ được in.
Bạn có thể cần lần đầu tiên chạy: updatedb(như root) để cập nhật / xây dựng cơ sở dữ liệu của locate.
ls, bạn gần như chắc chắn làm sai cách .