Exclude Loop devices from fdisk -l

sudo fdisk -l

Use SED script in command line to strip lines containing “Disk /dev/loop” pattern and delete following 5 lines including stripped line

sudo fdisk -l | sed -e '/Disk \/dev\/loop/,+5d'

~/.bashrc: alias shorthand to make it easier to remember

alias fdsk="sudo fdisk -l | sed -e '/Disk \/dev\/loop/,+5d'"

Then simply type fdsk in the command line and enter your password when prompted.

Credit remove dev loops

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out comment
Enter name