>  기사  >  시스템 튜토리얼  >  찾기 명령: find -name보다 빠른 파일 검색 도구

찾기 명령: find -name보다 빠른 파일 검색 도구

WBOY
WBOY원래의
2024-06-02 09:56:24463검색

기능 소개:

lococate 명령은 분명히 find-name을 작성하는 또 다른 방법이며 이전 Linux vi보다 훨씬 빠릅니다. 그 이유는 특정 디렉터리를 검색하지 않고 /var/lib/ locatedb 데이터베이스를 검색하기 때문입니다. 주목할 가치가 있는 점은 다음과 같습니다. 버전이 다르면 달라집니다. 일부 버전 위치는 /var/lib/mlocate/mlocationbLinux 검색 파일이 있는 디렉토리이고 다른 버전 위치는 /var/lib/slocate/slocate.db입니다. 이 데이터베이스는 모든 로컬 파일 정보가 풍부합니다. Linux 시스템은 이 데이터베이스를 수동으로 생성합니다linux는 파일이 있는 디렉토리를 검색하지만 매일 밤 수동으로 업데이트되므로 Locate 명령을 사용하여 최근에 변경된 파일을 찾을 수 없습니다. Redhat Linux에서 이러한 상황을 방지하기 위해, 찾기를 사용하기 전에 updateb 명령을 사용하여 데이터베이스를 자동으로 업데이트할 수 있습니다.

linuxfind查找目录名_linux搜索目录名_linux搜索文件所在目录

문장 형식: 찾기[매개변수][스타일]

일반적으로 사용되는 매개변수:

linux搜索文件所在目录_linux搜索目录名_linuxfind查找目录名

-d 또는 –database=

데이터베이스가 위치한 디렉터리를 지정하세요

–도움말

도움말 표시

–버전

버전 정보 표시

linux搜索目录名_linux搜索文件所在目录_linuxfind查找目录名

linuxfind查找目录名_linux搜索文件所在目录_linux搜索目录名

참조 예:

도움말 표시:

으아아아

/etc 디렉토리에서 sh로 시작하는 모든 파일을 검색하세요.

으아아아

/etc 디렉토리에서 k로 시작하는 파일 검색:

으아아아

linuxfind查找目录名_linux搜索文件所在目录_linux搜索目录名

pwd와 관련된 모든 파일 찾기:

[root@linuxcool ~]# locate --help
 Usage: locate [OPTION]… [PATTERN]…
 Search for entries in a mlocate database.
 -A, --all only print entries that match all patterns
 -b, --basename match only the base name of path names
 -c, --count only print number of found entries
 -d, --database DBPATH use DBPATH instead of default database (which is
 /var/lib/mlocate/mlocate.db)
 -e, --existing only print entries for currently existing files
 -L, --follow follow trailing symbolic links when checking file
 existence (default)
 -h, --help print this help
 -i, --ignore-case ignore case distinctions when matching patterns
 -l, --limit, -n LIMIT limit output (or counting) to LIMIT entries
 -m, --mmap ignored, for backward compatibility
 -P, --nofollow, -H don't follow trailing symbolic links when checking file
 existence
 -0, --null separate entries with NUL on output
 -S, --statistics don't search for entries, print statistics about each
 used database
 -q, --quiet report no error messages about reading databases
 -r, --regexp REGEXP search for basic regexp REGEXP instead of patterns
 --regex patterns are extended regexps
 -s, --stdio ignored, for backward compatibility
 -V, --version print version information
 -w, --wholename match whole path name (default)
 Report bugs to mitr@redhat.com.
显示版本信息:
[root@linuxcool ~]# locate --version
 mlocate 0.26
 Copyright (C) 2007 Red Hat, Inc. All rights reserved.
 This software is distributed under the GPL v.2.
 This program is provided with NO WARRANTY, to the extent permitted by law.

위 내용은 찾기 명령: find -name보다 빠른 파일 검색 도구의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.