Skip to content

Instantly share code, notes, and snippets.

cat /proc/*/status | grep -E 'VmSwap:|Name:' | grep VmSwap -B1 | cut -d':' -f2 | grep -v '\-\-' | grep -o -E '[a-zA-Z0-9]+.*$' | cut -d' ' -f1 | xargs -n2 echo | sort -k2 -n | cut -f2 -d' '| tr '\n' '+' | sed 's/+$/\n/' | bc
@pallinger
pallinger / diff_changed_config_files.sh
Last active July 4, 2024 17:28
diff changed config files with the default ones on a debian system
#!/bin/bash
name=`basename $0`
tmp=/tmp/$name.tmp
missingPattern='^debsums: missing file'
# get differing files using debsums
debsums -e| awk '$2 !~ /OK/{print $1}' > $tmp.1
# print missing