Check swap on Ubuntu

jonas@yggdrasil:~$ sudo swapon --show
NAME      TYPE       SIZE USED PRIO
/dev/dm-2 partition 11.9G   0B   -1
jonas@yggdrasil:~$

jonas@yggdrasil:~$ sudo free -m
              total        used        free      shared  buff/cache   available
Mem:          11925        9240         911         305        1773        2110
Swap:         12195           0       12195
jonas@yggdrasil:~$ 

Wipe USB drive in Linux by overwriting with random data

Handy way to wipe a USB drive in Linux using dd and /dev/urandom:

jonas@yggdrasil:~$ sudo dd if=/dev/urandom of=/dev/sdc bs=4k
dd: error writing '/dev/sdc': No space left on device
15163393+0 records in
15163392+0 records out
62109253632 bytes (62 GB, 58 GiB) copied, 2227.1 s, 27.9 MB/s

Of course, make sure /dev/sdX is the USB device you want to wipe. DD isn’t being referred to as the “Disk Destroyer” for nothing 🙂