This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
shell2 [2021/05/21 00:04] 127.0.0.1 external edit |
shell2 [2022/10/17 12:31] (current) dblume [Protips for find] |
||
---|---|---|---|
Line 292: | Line 292: | ||
# at 3 in the morning on Mondays, delete files older than 30 days | # at 3 in the morning on Mondays, delete files older than 30 days | ||
0 3 * * 1 find $HOME/ | 0 3 * * 1 find $HOME/ | ||
+ | </ | ||
+ | |||
+ | ====== Calculate web server bandwidth ====== | ||
+ | |||
+ | Use '' | ||
+ | |||
+ | < | ||
+ | $ sudo cat / | ||
+ | 0.855597 | ||
</ | </ | ||
Line 551: | Line 560: | ||
find lib -type f -name \*.so\* -exec sh -c ' | find lib -type f -name \*.so\* -exec sh -c ' | ||
| | ||
- | Note that you can pass -print (or -and -print) after a -exec argument. Also, the " - " is just a placeholder for $0 (usually the command name, in this case " | + | Note that you can pass -print (or -and -print) after a -exec argument. You can also use -printf, ex., '' |
NEEDED | NEEDED |