This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
shell2 [2019/12/17 16:40] dblume search is hanging on shell page. This is a test page. |
shell2 [2022/10/17 12:31] (current) dblume [Protips for find] |
||
|---|---|---|---|
| Line 274: | Line 274: | ||
| fi | fi | ||
| } | } | ||
| - | </ | ||
| - | |||
| - | Note the use of $@ vs " | ||
| - | |||
| - | <code bash> | ||
| - | telnet_log() { | ||
| - | curtime=$(date -Iseconds | tr : .) | ||
| - | args=$(echo " | ||
| - | telnet $@ | tee $HOME/ | ||
| - | } | ||
| - | |||
| - | last_telnet_log() { | ||
| - | ls -d1t $HOME/ | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | Of course if you do that, you'll want to occasionally (via cronjob?) delete old archives. | ||
| - | |||
| - | < | ||
| - | find $HOME/ | ||
| </ | </ | ||
| Line 312: | 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 390: | 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 554: | Line 543: | ||
| David' | David' | ||
| </ | </ | ||
| + | |||
| + | ====== XML XPath Tips ====== | ||
| + | |||
| + | Here's how to use xmllint to take an XPath path to extract info from the Roku ECP Apps list. | ||
| + | |||
| + | http 192.168.1.128: | ||
| + | http 192.168.1.128: | ||
| + | |||
| ====== Protips for find ====== | ====== Protips for find ====== | ||
| Line 563: | 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 | ||