Differences
This shows you the differences between two versions of the page.
— | find [2016/02/19 20:11] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== find ====== | ||
+ | * [[findutils]] | ||
+ | * [[xargs]] | ||
+ | |||
+ | == Find only files == | ||
+ | |||
+ | < | ||
+ | find /dir -type f | ||
+ | </ | ||
+ | |||
+ | == Find only directories == | ||
+ | |||
+ | < | ||
+ | find /dir -type d | ||
+ | </ | ||
+ | |||
+ | == Match expression == | ||
+ | |||
+ | < | ||
+ | find /dir -name ' | ||
+ | </ | ||
+ | |||
+ | == Find files matching an extension == | ||
+ | |||
+ | < | ||
+ | find /dir -name ' | ||
+ | </ | ||
+ | |||
+ | == Find files not matching a rule == | ||
+ | |||
+ | < | ||
+ | find /dir -! -name ' | ||
+ | </ | ||
+ | |||
+ | == Find files less than a day old == | ||
+ | |||
+ | < | ||
+ | find /dir -mtime -1 | ||
+ | </ | ||
+ | |||
+ | == sort the results even with print0 == | ||
+ | |||
+ | < | ||
+ | find / | ||
+ | </ | ||
+ | |||
+ | == find directories but ignore dot directories == | ||
+ | |||
+ | < | ||
+ | find / | ||
+ | </ | ||
+ | |||
+ | == find files and run ' | ||
+ | |||
+ | < | ||
+ | find . -type f -ls | ||
+ | </ | ||
+ | |||
+ | == find empty files == | ||
+ | |||
+ | < | ||
+ | find . -type f -empty | ||
+ | </ |