Oneliners: Difference between revisions
From fakedWiki
m (1 revision imported) |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
Get the size of the a folder and it's subdirectories, sorted by size: | Get the size of the a folder and it's subdirectories, sorted by size: | ||
<pre> | <pre> | ||
du --max-depth=1 | du -hx --max-depth=1 | sort -h | ||
</pre> | </pre> | ||
(removed the convoluted old command, this is much simpler) | |||
=== Postfix === | === Postfix === |
Latest revision as of 20:27, 26 August 2016
MySQL
Get the "hit rate" percentage of Connections vs. Threads_created, helps you with finding the sweet spot for thread_cache_size (the closer to 100%, the better):
echo "scale=4; 100-`mysql -NB -e "SHOW STATUS LIKE 'Threads_created'; SHOW STATUS LIKE 'Connections';" | awk '{print $2}' | tr '\n' '/'`100" | bc
Filesystem
Get the size of the a folder and it's subdirectories, sorted by size:
du -hx --max-depth=1 | sort -h
(removed the convoluted old command, this is much simpler)
Postfix
Mass-Delete from mailqueue by sender address
mailq | awk ' /^[0-9A-F][0-9A-F]*.*user@example.com$/ {print $1}' | xargs -rn1 postsuper -d