Zum Inhalt springen

Locate: Unterschied zwischen den Versionen

Aus Foxwiki
K Textersetzung - „line>“ durch „line copy>“
 
(50 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
'''{{BASEPAGENAME}}''' - Beschreibung
'''locate''' - schnelle Suche nach Dateinamen


== Beschreibung ==
== Beschreibung ==
; Index basiert
Zuvor erstellter Index
* Nicht das Dateisystem (wie bei [[find]])
* Schnelle Suche nach Dateinamen oder -pfaden
* Diese wird regelmäßig aktualisiert
; Vorteil
* Schnelle Suchergebnisse
; Nachteil
* Index evtl. nicht aktuell
* Nicht alle Verzeichnisse werden durchsucht
** /tmp, /var/spool, /media
=== Implementierungen ===
{| class="wikitable options big"
|-
! Paket !! Beschreibung
|-
| [[locate]] || findutils/locate
|-
| [[mlocate]] ||
|-
| [[plocate]] || Schnelleres [[mlocate]]
|}


== Installation ==
== Installation ==
<syntaxhighlight lang="bash" highlight="1" line>
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo apt install plocate
</syntaxhighlight>
</syntaxhighlight>


== Aufruf ==
== Aufruf ==
<syntaxhighlight lang="bash" highlight="1" line>
<syntaxhighlight lang="bash" highlight="1" line copy>
plocate [OPTIONEN] PATTERNS
</syntaxhighlight>
</syntaxhighlight>


Zeile 16: Zeile 43:
! Unix !! GNU !! Parameter !! Beschreibung
! Unix !! GNU !! Parameter !! Beschreibung
|-
|-
| || || ||  
| || || ||
|-
|-
|}
|}


=== Parameter ===
== Anwendung ==
=== Index aktualisieren ===
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo updatedb
</syntaxhighlight>
siehe [[updatedb]]


=== Umgebungsvariablen ===
=== Nach Dateipfaden suchen ===
 
<syntaxhighlight lang="bash" highlight="1" line copy>
=== Exit-Status ===
locate doc/fonts
{| class="wikitable options col1center"
</syntaxhighlight>
|-
! Wert !! Beschreibung
|-
| 0 || Erfolg
|-
| >0  || Fehler
|}


== Anwendung ==
=== Groß-/Kleinschreibung ignorieren ===
<syntaxhighlight lang="bash" highlight="1" line>
<syntaxhighlight lang="bash" highlight="1" line copy>
locate -i Suchbegriff
</syntaxhighlight>
</syntaxhighlight>
=== Problembehebung ===


== Konfiguration ==
== Konfiguration ==
Zeile 47: Zeile 71:
! Datei !! Beschreibung
! Datei !! Beschreibung
|-
|-
| ||  
| ||
|-
|-
| ||  
| ||
|}
|}
=== Umgebung ===
; LOCATE_PATH
* Wenn angegeben, wird es nach der Liste der --database-Pfade angehängt
** unabhängig davon, ob ein expliziter Wert angegeben wurde oder der Standardwert verwendet wird
* Trennung durch Doppelpunkte und Zeichen-Escape-Sequenzen folgen denselben Regeln wie für --database
<noinclude>
<noinclude>


Zeile 56: Zeile 87:
=== Siehe auch ===
=== Siehe auch ===
{{Special:PrefixIndex/{{BASEPAGENAME}}/}}
{{Special:PrefixIndex/{{BASEPAGENAME}}/}}
* [[mlocate]](1)
* [[updatedb]](8)


=== Dokumentation ===
=== Dokumentation ===
 
; Man-Page
; Man-Page  
# [https://manpages.debian.org/bookworm/plocate/locate.1.en.html locate(1)]
# [https://manpages.debian.org/stable/procps/pgrep.1.de.html prep(1)]
 
; Info-Pages


=== Links ===
=== Links ===
Zeile 69: Zeile 99:
==== Weblinks ====
==== Weblinks ====


 
{{DEFAULTSORT:locate}}
{{DEFAULTSORT:new}}
{{DISPLAYTITLE:new}}
 
[[Kategorie:new]]
 
</noinclude>
 
= TMP =
{{DISPLAYTITLE:locate}}
{{DISPLAYTITLE:locate}}
'''locate''' sucht schnell nach Dateinamen
= Installation =
# '''apt install plocate'''
= Syntax =
$ '''plocate [OPTION]...  PATTERN...'''
== Argumente ==
== Optionen ==
{| class="wikitable sortable"
|-
! Aufgabe !! Befehl !! Link
|-
| -A || --all || Ignored for compatibility with mlocate(1).
|-
| -b || --basename || Match  only against the file name portion of the path name, ie., the directory names will be excluded from the match (but still printed). This does not speed up the search, but can suppress uninteresting matches.
|-
| -c || --count || Do not print each match. Instead, count them, and print out a total number at the end.
|-
| -d || --database DBPATH || Find matches in the given database, instead of /var/lib/plocate/plocate.db.  This argument can be given multiple  times,  to  search  multiple databases.  It is also possible to give multiple databases in one argument, separated by :.  (Any character, including : and \, can be escaped by prepending a \.)
|-
| -e || --existing || Print only entries that refer to files existing at the time locate is run. Note that unlike mlocate(1), symlinks are not followed  by  default (and indeed, there is no option to change this).
|-
| -i || --ignore-case || Do a case-insensitive match as given by the current locale (default is case-sensitive, byte-by-byte match). Note that plocate does not support the full range of Unicode case folding rules; in particular, searching for ß will not give you matches on ss even in  a  German  locale.  Also note that this option will be somewhat slower than a case-sensitive match, since it needs to generate more candidates for searching the index.
|-
| -l || --limit LIMIT || Stop searching after LIMIT matches have been found. If --count is given, the number printed out will be at most LIMIT.
|-
| -N || --literal || Print  entry  names  without  quoting. Normally, plocate will escape special characters in filenames, so that they are safe for consumption by typical shells (similar to the GNU coreutils shell-escape-always quoting style), unless printing to a pipe, but this  options  will  turn  off such quoting.
|-
| -0 || --null || Instead  of  writing  a newline after every match, write a NUL (ASCII 0). This is useful for creating unambiguous output when it is to be processed by other tools (like xargs(1)), as filenames are allowed to contain embedded newlines.
|-
| -r || --regexp || Patterns are taken to be POSIX basic regular expressions.  See regex(7) for more information. Note that this forces a linear scan through  the entire database, which is slow.
|-
| || --regex  || Like --regexp, but patterns are instead taken to be POSIX extended regular expressions.
|-
| -w || --wholename || Match  against  the  entire path name. This is the default, so unless -b is given first (see above), it will not do anything. This option thus exists only as compatibility with mlocate(1).
|-
| || --help Print  || out usage information, then exit successfully.
|-
| || --version  || Print out version information, then exit successfully
|}
= Konfiguration =
== Index aktualisieren ==
# '''updatedb'''
siehe [[Linux/Befehl:updatedb]]
== Dateien ==
== Umgebegung ==
'''LOCATE_PATH'''
* If given, appended after the list of --database paths (whether an explicit is given or the default is used)
* Colon-delimiting  and  character escaping follows the same rules as for --database.
= Anwendung =
== Nach Dateipfaden suchen ==
$ '''locate doc/fonts'''
== Groß-/Kleinschreibung ignorieren ==
$ '''locate -i Suchbegriff'''
= Dokumentation =
== Man-Page ==
# locate(1)
# plocate-build(8)
# mlocate(1)
# updatedb(8)
== Info-Pages ==
= Links =
== Intern ==
# [[updatedb]]
== Weblinks ==


[[Kategorie:Linux/Suchen]]
[[Kategorie:Linux/Suchen]]
[[Kategorie:Linux/Befehl]]
[[Kategorie:Linux/Befehl]]
{{DEFAULTSORT:locate}}
 
</noinclude>

Aktuelle Version vom 11. Mai 2025, 13:45 Uhr

locate - schnelle Suche nach Dateinamen

Beschreibung

Index basiert

Zuvor erstellter Index

  • Nicht das Dateisystem (wie bei find)
  • Schnelle Suche nach Dateinamen oder -pfaden
  • Diese wird regelmäßig aktualisiert
Vorteil
  • Schnelle Suchergebnisse
Nachteil
  • Index evtl. nicht aktuell
  • Nicht alle Verzeichnisse werden durchsucht
    • /tmp, /var/spool, /media

Implementierungen

Paket Beschreibung
locate findutils/locate
mlocate
plocate Schnelleres mlocate

Installation

sudo apt install plocate

Aufruf

plocate [OPTIONEN] PATTERNS

Optionen

Unix GNU Parameter Beschreibung

Anwendung

Index aktualisieren

sudo updatedb

siehe updatedb

Nach Dateipfaden suchen

locate doc/fonts

Groß-/Kleinschreibung ignorieren

locate -i Suchbegriff

Konfiguration

Dateien

Datei Beschreibung

Umgebung

LOCATE_PATH
  • Wenn angegeben, wird es nach der Liste der --database-Pfade angehängt
    • unabhängig davon, ob ein expliziter Wert angegeben wurde oder der Standardwert verwendet wird
  • Trennung durch Doppelpunkte und Zeichen-Escape-Sequenzen folgen denselben Regeln wie für --database


Anhang

Siehe auch

Dokumentation

Man-Page
  1. locate(1)

Links

Projekt

Weblinks