將資料夾指向到其他位置

如果 Mac 本機的容量不足,但是應用程式卻需要固定路徑才能使用,此時可以使用 symbolic link ,將原來的位置指向到另外一個位置。

DiffusionBee 為例,他的資料夾位置是在 ~/.diffusionbee ,我們可以把這個資料夾指向到外部硬碟的位置

  1. 使用 mv 指令把 ~/.diffusionbee 移動到外部硬碟位置
    • mv ~/.diffusionbee '/Volumes/外部硬碟/bee/'
  2. 使用 ln -s 將外部硬碟位置連接到 ~/.diffusionbee
    • ln -s /Volumes/外部硬碟/bee/.diffusionbe ~/.diffusionbee

如果需要再次更改,連接到其他硬碟的話,只需要使用 rm 指令刪除原來鏈結,再次建立即可
rm ~/.diffusionbee
ln -s /Volumes/另一個外部硬碟/bee_new/.diffusionbee ~/.diffusionbee

參考: https://michaelcharl.es/aubrey/en/code/diffusionbee-on-external-storage

評論