terminal.cab

Alle Befehle

find

Thema: Suchen

Programm: find

Sucht Dateien nach Name, Größe, Zeit und Rechten und wendet Befehle darauf an.

Paket: find-xargs

Aufruf

find [PATH]... [EXPRESSION]

Beschreibung

Walk through each PATH (the current directory if none is given) and everything below it, and check every name against EXPRESSION. Without an action, every name for which the expression is true is printed. Tests (N as +N for more than N, -N for less than N, N for exactly N): -name PATTERN, -iname PATTERN the name matches (* ? [...], -iname ignores case) -path PATTERN, -ipath PATTERN the whole path matches (also -wholename) -type X, -xtype X f file, d directory, l symbolic link (-xtype: what the link points to) -size N[ckMG] size in units, rounded up (no unit: blocks of 512 bytes) -mtime N, -mmin N changed N days or N minutes ago (also -atime, -amin, -ctime, -cmin) -newer FILE changed after FILE -perm MODE, -perm -MODE, -perm /MODE exactly these, at least all, or any of these permission bits -user NAME, -group NAME, -uid N, -gid N, -links N -readable, -writable, -executable, -empty, -true, -false Actions: -print and -print0 show the name (ending in a newline or a null byte), -delete removes it, -prune keeps find out of a directory, -quit stops at once. -exec COMMAND ; runs COMMAND for each name, {} stands for the name; with {} + at the end it runs once for many names. -ok is like -exec with ; but asks first. Combine with ( ), ! (not), -a (and, also between two tests), -o (or) and the comma (both, the last counts). -maxdepth N, -mindepth N go at most N levels down, leave out the first N levels -depth check a directory after its content (as -delete does) -P, -L, -H (before PATH) never follow symbolic links (default), always, only for each PATH

Optionen im Simulator

80 weitere Optionen des echten Programms, im Simulator noch nicht
  • -H im Simulator noch nicht

    Erklärung folgt

  • -L im Simulator noch nicht

    Erklärung folgt

  • -P im Simulator noch nicht

    Erklärung folgt

  • -D braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • -O braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --daystart im Simulator noch nicht

    Erklärung folgt

  • --follow im Simulator noch nicht

    Erklärung folgt

  • --nowarn im Simulator noch nicht

    Erklärung folgt

  • --regextype braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --warn im Simulator noch nicht

    Erklärung folgt

  • --depth im Simulator noch nicht

    Erklärung folgt

  • --files0-from braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --maxdepth braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --mindepth braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --mount im Simulator noch nicht

    Erklärung folgt

  • --noleaf im Simulator noch nicht

    Erklärung folgt

  • --xdev im Simulator noch nicht

    Erklärung folgt

  • --ignore_readdir_race im Simulator noch nicht

    Erklärung folgt

  • --noignore_readdir_race im Simulator noch nicht

    Erklärung folgt

  • --amin braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --anewer braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --atime braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --cmin braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --cnewer braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --context braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --ctime braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --empty im Simulator noch nicht

    Erklärung folgt

  • --false im Simulator noch nicht

    Erklärung folgt

  • --fstype braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --gid braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --group braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --ilname braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --iname braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --inum braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --ipath braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --iwholename braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --iregex braucht einen Wert im Simulator noch nicht

    Im echten Linux prüft -regex den ganzen Pfad mit einem regulären Ausdruck. Probier -path mit * und ?.

  • --links braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --lname braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --mmin braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --mtime braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --name braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --newer braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --nouser im Simulator noch nicht

    Erklärung folgt

  • --nogroup im Simulator noch nicht

    Erklärung folgt

  • --path braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --perm braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --regex braucht einen Wert im Simulator noch nicht

    Im echten Linux prüft -regex den ganzen Pfad mit einem regulären Ausdruck. Probier -path mit * und ?.

  • --readable im Simulator noch nicht

    Erklärung folgt

  • --writable im Simulator noch nicht

    Erklärung folgt

  • --executable im Simulator noch nicht

    Erklärung folgt

  • --wholename braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --size braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --true im Simulator noch nicht

    Erklärung folgt

  • --type braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --uid braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --used braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --user braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --xtype braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --delete im Simulator noch nicht

    Erklärung folgt

  • --print0 im Simulator noch nicht

    Erklärung folgt

  • --printf braucht einen Wert im Simulator noch nicht

    Im echten Linux gibt -printf jeden Treffer in einem eigenen Format aus (Größe, Datum, Rechte).

  • --fprintf braucht einen Wert im Simulator noch nicht

    Im echten Linux gibt -printf jeden Treffer in einem eigenen Format aus (Größe, Datum, Rechte).

  • --print im Simulator noch nicht

    Erklärung folgt

  • --fprint0 braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --fprint braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --ls im Simulator noch nicht

    Im echten Linux zeigt -ls jeden Treffer wie ls -dils. Probier -exec ls -ld {} +.

  • --fls braucht einen Wert im Simulator noch nicht

    Im echten Linux zeigt -ls jeden Treffer wie ls -dils. Probier -exec ls -ld {} +.

  • --prune im Simulator noch nicht

    Erklärung folgt

  • --quit im Simulator noch nicht

    Erklärung folgt

  • --exec braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --execdir braucht einen Wert im Simulator noch nicht

    Im echten Linux startet -execdir den Befehl im Verzeichnis des Treffers. Probier -exec.

  • --ok braucht einen Wert im Simulator noch nicht

    Erklärung folgt

  • --okdir braucht einen Wert im Simulator noch nicht

    Im echten Linux startet -execdir den Befehl im Verzeichnis des Treffers. Probier -exec.

  • --not im Simulator noch nicht

    Erklärung folgt

  • --a im Simulator noch nicht

    Erklärung folgt

  • --and im Simulator noch nicht

    Erklärung folgt

  • --o im Simulator noch nicht

    Erklärung folgt

  • --or im Simulator noch nicht

    Erklärung folgt

  • --version im Simulator noch nicht

    Erklärung folgt

Beispiele

Aus der Lektion Suchen
find . -name '*.txt'
./Dokumente/Urlaub 2027.txt
./Dokumente/brief.txt
./Dokumente/notizen.txt
./Dokumente/rezepte.txt
./notizen.txt

Im Terminal ausprobieren

Aus der Lektion Suchen
find . -type d
.
./.config
./Dokumente
./Downloads
./Bilder
./projekte
./projekte/webseite

Im Terminal ausprobieren

Aus der Lektion Abschluss-Szenario: Aufräumen im Downloads-Ordner
find Downloads -name '*(1)*'
Downloads/rechnung-2026-10(1).pdf
Downloads/strand(1).jpg

Im Terminal ausprobieren

Aus der Lektion Dateien nach Name, Alter und Größe finden
find . -size +40M
./archiv/shop-2026-08.tar.gz
./archiv/shop-2026-09.tar.gz
find . -name "*.log" -mtime +30
./projekte/shop/build.log

Im Terminal ausprobieren

Aus der Lektion Abzweigen und weiterreichen
find cache -name "*.tmp" -print0 | xargs -0 -n 1 echo rm
rm cache/a.tmp
rm cache/b.tmp
rm cache/old report.tmp
find cache -name "*.tmp" -print0 | xargs -0 rm
ls cache
keep.log

Im Terminal ausprobieren

Aus dem Befehl des Tages: find -name
find . -name '*.log'
./logs/app.log
./logs/old.log

Im Terminal ausprobieren

Aus dem Befehl des Tages: find -type d
find . -type d
.
./Dokumente
./Downloads
./logs
./alt

Im Terminal ausprobieren

Wo du ihn lernst

Lektionen

Befehl des Tages

Alle Befehle