MacOS Tips

  • 在命令行中打开Finder
$ open .
$ open ~/Documents/
  • 列举分区
$ diskutil list
...
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *120.0 GB   disk2
   1:               Windows_NTFS                         104.9 MB   disk2s1
   2:               Windows_NTFS                         119.4 GB   disk2s2
   3:                       0x27                         479.2 MB   disk2s3
  • 删除分区
$ diskutil eraseDisk JHFS+ Samsung /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk2s2 as Mac OS Extended (Journaled) with name Samsung
Initialized /dev/rdisk2s2 as a 111 GB case-insensitive HFS Plus volume with a 16384k journal
Mounting disk
Finished erase on disk2
  • 禁止MacBook的启动音

Mac用户都了解每次开机或者重启电脑的时候,都会有一个很特别的开机启动音。如果想要临时禁止这个开机启动音,一个办法就是开机的时候一直按住键盘上的静音键,当然你也可以使用下面使用终端命令的方法: 通过Spotlight搜索并打开[终端]程序,之后输入如下命令并回车,来禁用开机启动音:

sudo nvram SystemAudioVolume=%80

之后会需要我们输入管理员密码。这样之后再次启动Mac的时候就是完全静音的了。 如果想要恢复正常的设置,那么在终端中再次输入如下命令即可:

sudo nvram -d SystemAudioVolume
  • 在命令行中打开Finder
open .
open ~/Documents/
  • 移除 Windows 磁盘/卷
$ diskutil list
...
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *120.0 GB   disk2
   1:               Windows_NTFS                         104.9 MB   disk2s1
   2:               Windows_NTFS                         119.4 GB   disk2s2
   3:                       0x27                         479.2 MB   disk2s3

$ diskutil eraseDisk JHFS+ Samsung /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk2s2 as Mac OS Extended (Journaled) with name Samsung
Initialized /dev/rdisk2s2 as a 111 GB case-insensitive HFS Plus volume with a 16384k journal
Mounting disk
Finished erase on disk2