Last active
October 8, 2018 16:06
-
-
Save enihsyou/95811e7d3835a74cbb6dc80cddc9a994 to your computer and use it in GitHub Desktop.
Create a 2GB RamDisk, format with APFS, detail in Chinese 中文: https://enihsyou.com/2018/10/08/47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SIZE=2048 | |
DISKNAME=RAM | |
DISK_ID=`hdiutil attach -nomount ram://$(( ${SIZE} * 1024 * 1024 / 512 ))` | |
diskutil partitionDisk $DISK_ID GPT APFS "$DISKNAME" 0 | |
# Oneline version | |
#diskutil partitionDisk `hdiutil attach -nomount ram://8388608` GPT APFS "RAM" 0 | |
cd /Volumes/$DISKNAME | |
mkdir -p Cache/Chrome | |
mkdir -p Temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can change Chrome cache directory with this command.
defaults write com.google.Chrome DiskCacheDir /Volumes/RAM/Cache/Chrome