软件有 iramdisk tmpdisk 这类…

其实mac 原生支持虚拟内存盘的.

1. 新建xx.sh 文件

!/bin/bash



Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB

DISK=/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864

DISK=/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152



/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK



CACHEDIR="/Volumes/RamDiskCache/$USER"



Chrome Cache

/bin/rm -rvf ~/Library/Caches/Google/Chrome/*

/bin/mkdir -pv $CACHEDIR/Google/Chrome/Default

/bin/ln -v -s $CACHEDIR/Google/Chrome/Default ~/Library/Caches/Google/Chrome/Default



Chrome Canary Cache

/bin/rm -rvf ~/Library/Caches/Google/Chrome\ Canary/*

/bin/mkdir -pv $CACHEDIR/Google/Chrome\ Canary/Default

/bin/ln -v -s $CACHEDIR/Google/Chrome\ Canary/Default ~/Library/Caches/Google/Chrome\ Canary/Default



Safari Cache

/bin/rm -rvf ~/Library/Caches/com.apple.Safari

/bin/mkdir -pv $CACHEDIR/Apple/Safari

/bin/ln -v -s $CACHEDIR/Apple/Safari ~/Library/Caches/com.apple.Safari



iTunes Cache

/bin/rm -rvf ~/Library/Caches/com.apple.iTunes

/bin/mkdir -pv $CACHEDIR/Apple/iTunes

/bin/ln -v -s $CACHEDIR/Apple/iTunes ~/Library/Caches/com.apple.iTunes



Spotify Cache

/bin/rm -rvf ~/Library/Caches/com.spotify.client

/bin/mkdir -pv $CACHEDIR/Spotify

/bin/ln -v -s $CACHEDIR/Spotify ~/Library/Caches/com.spotify.client



/usr/bin/chflags hidden /Volumes/RamDiskCache #Hide RamDisk directory

2. 执行 shell命令.

终端 ./ramdisk.sh

无权限: chmod -R 775 radmdisk.sh

3. 文件夹 jekyll 放到虚拟磁盘里运行

4. 设置开机启动.

系统设置 → 用户群组→ 登录选项 → 左下角解锁→ 添加刚才新建的脚本