This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
shell2 [2020/08/02 15:55] dblume Added XML XPath tips for Roku ECP Apps list |
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 370: | Line 379: | ||
| Alternatively, | Alternatively, | ||
| <code bash> | <code bash> | ||
| - | while true; do sync; cat /proc/$(pidof yourprocess)/ | + | PID=$(pidof yourprocess); |
| </ | </ | ||
| ====== Measuring Available Memory ====== | ====== Measuring Available Memory ====== | ||
| 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 | ||