shell2
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| shell2 [2019/12/22 09:40] – move telnet tip to telnet wiki page dblume | shell2 [2024/10/07 22:00] (current) – dblume | ||
|---|---|---|---|
| Line 51: | Line 51: | ||
| declare -r SCRIPT_NAME=$(basename " | declare -r SCRIPT_NAME=$(basename " | ||
| - | ## exit the shell (default status code: 1) after printing the message to stderr | + | # exit (default status code: 1) after printing the message to stderr |
| die() { | die() { | ||
| echo >&2 " | echo >&2 " | ||
| 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 534: | 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 543: | 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 | ||
| lib/ | lib/ | ||
| + | Tip: tar up the last day's worth of log files: | ||
| + | |||
| + | find . -mtime -1 -name \*.log -print0 | tar -jcvf logs.tar.bz2 --null -T - | ||
| ====== Additional Keywords ====== | ====== Additional Keywords ====== | ||
| Linux, Unix, *nix | Linux, Unix, *nix | ||
shell2.1577036424.txt.gz · Last modified: 2023/04/12 20:44 (external edit)