Skip to main content

Hi guys



I've been trying to get the IDENTIFIER of a usb stick plugged in so i can use disk1s1 as a variable



Im having problems cutting out the spaces and i was wondering if anyone knows how to just get disk1s1?



This is what i have so far



diskutil list | grep RALLY | grep disk
1: Windows_FAT_32 RALLY2 64GB 64.2 GB disk1s1

encase it is double quotes:



for example:



diskutil list | grep "Macintosh HD"

@acdesigntech - I'm sorry I don't understand what that means.


sorry, typo. I meant encase it IN double quotes. so take your command and put double quotes around the drive name. That way it will preserve the space between macintosh and hd.



Something like:



diskutil secureErase freespace 3/ Volumes/"name-of-drive"

I get this for a response



Kens-Macbook-Pro:~ Ken1$ diskutil secureErase freespace 3/ Volume/"Macintosh HD"
Could not find the disk Volume/Macintosh HD



I can't think why it can't seem to find my hard drive. The icon on my desktop sayings Macintosh HD in white under the icon. I have to believe that's the name, correct?


Try Volumes & not Volume.


Kens-Macbook-Pro:~ Ken1$ diskutil secureErase freespace 3/ Volumes/"Macintosh HD"
Could not find the disk Volumes/Macintosh HD



lol going insane here


Sorry. Try: /Volumes/ then.


winnah winnah chicken dinnah!! Thank you!! :)


No worries.



I've wasted hours over silly syntax issues too.