Linux/Snippets: Difference between revisions
< Linux
(Die Seite wurde neu angelegt: „List directory sizes <blockquote> <pre> clear; for each in $(ls) ; do du -hs "$each" ; done </pre> </blockquote> Manual SSD Trim <blockquote> <pre> sudo fs…“) |
No edit summary |
||
Line 1: | Line 1: | ||
== File system & drives == | |||
List directory sizes | List directory sizes | ||
<blockquote> | <blockquote> | ||
<pre> | <pre> | ||
clear; for each in $(ls) ; do du -hs "$each" ; done | clear; for each in $(ls) ; do du -hs "$each" ; done | ||
</pre> | |||
</blockquote> | |||
show hdd power states | |||
<blockquote> | |||
<pre> | |||
sudo hdparm -C /dev/sd? | |||
</pre> | </pre> | ||
</blockquote> | </blockquote> |
Revision as of 08:12, 26 October 2012
File system & drives
List directory sizes
clear; for each in $(ls) ; do du -hs "$each" ; done
show hdd power states
sudo hdparm -C /dev/sd?
Manual SSD Trim
sudo fstrim -v /
Cron SSD Trim
- /etc/scripts/fstrim.sh:
#!/bin/sh # echo `date +"%d %b %H:%M:%S"` | tr -d '\n' >> /var/log/fstrim /sbin/fstrim -v / >> /var/log/fstrim
- /etc/cron.d/fstrim:
# 0 * * * * root /etc/scripts/fstrim.sh