Getting a random file from a directory

DateReadtime 1 minutes Tags

I had a massive directory of files that I wanted to pick a few random files to test before I imported the whole set. For this post lets say I want 100 random files from some_dir and moving them to this_dir.

First you could use:

$ LIST=$(ls -1 ./some_dir | sort …
more ...

LVM resize

DateReadtime 1 minutes Tags
lvm / bash / sh

My root partition recently ran out of space and I needed to resize it.

So I booted into a live usb and then, after activating my volume groups:

$ sudo vgchange -a y

I looked up lvm resize online and came up with the command:

$ sudo lvextend -L+10G /dev/mapper …
more ...