I want the output of:
diskutil list; diskutil info [multiple devices]
Without having to do:
diskutil info disk0; diskutil info disk0s1; diskutil info disk1 ...etc
For example, with many builtin commands like touch rm mkdir, etc. I can use bracket expansion to perform commands on multiple versions of a file:
mkdir njboot0{1,2,3}
Or, when searching, I can use special characters to specify matching specific patterns in a string, like:
find ~/ -type f \( -name *mp3 -or -name *mp4 \)
But:
diskutil info disk{0,0s1,1,1s1} #syntax error
diskutil info /dev/* #syntax error
(diskutil info disk$'')$'0|1|2' #syntax error
diskutil info disk\(0,s0\) #syntax error
etc...
diskutil info disk${disk}'0'$'s1' #okay, getting somewhere. this works at least.
- How do I perform the
diskutilcommand mentioned above on multiple disks correctly? - Is there any general syntax I can follow for expansion/substitution?
As requested, this is the output of diskutil list:
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 999.7 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
diskutilseems not to be available for at least my distro. What exactly is the output ofdiskutil list?diskutilwas a poor choice. second q still applies to bash syntax in general.