lpi1:find
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
find
Aufgaben:
- suche alle Dateien im System, welche ein Leerzeichen beinhalten.
- suche alle leeren Dateien auf der Festplatte und gebe die Datei-Metadaten aus (Pseudo-Dateisysteme ausschließen)
exec & friends
cd
cp -a /usr/share/doc/ .
time find doc -type f -executable -exec chmod -x {} \;
time find doc -type f -executable -exec chmod -x {} +
find doc -type f -executable -print0 | xargs -0 chmod -x
Ausgabe steuern
find / -type f -printf "%s %p\n" | sort -n | tac | head -5
nach Änderungszeit suchen
touch -d '12 hours ago' /tmp/12_hours_ago touch -d '1 day ago' /tmp/1_day_ago touch -d '1 day ago 12 hours ago' /tmp/1_day_ago_12_hours_ago touch -d '2 days ago' /tmp/2_days_ago
date -r /tmp/1_day_ago_12_hours_ago
find /tmp -name '*ago' -mtime -1 find /tmp -name '*ago' -mtime 1 find /tmp -name '*ago' -mtime +1 find /tmp -name '*ago' -mtime +0 find / -xdev -newer /tmp vorher
lpi1/find.1461074692.txt.gz · Zuletzt geändert: 2016/04/19 14:04 von ingo_wichmann
