Advertisement
metalx1000

Find all Bootable Partitions

Aug 4th, 2017
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. #displays partition info with * in second colonum for boot partition
  2. sudo fdisk -l
  3.  
  4. #Just greping for * does not work
  5. sudo fdisk -l |grep '*' #quotes need around *
  6.  
  7. #use awk to find match in second colum
  8. sudo fdisk -l | awk '$2 == "*"
  9.  
  10. #display just the partition match
  11. sudo fdisk -l | awk '$2 == "*" {print $1}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement