Linux/Snippets

From Wiki
< Linux
Revision as of 16:50, 20 July 2012 by Marcluer (talk | contribs) (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…“)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

List directory sizes

clear;   for each in $(ls) ; do du -hs "$each" ; done


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