Linux如何自定義回收站路徑

Linux如何自定義回收站路徑

本文介紹如何在linux系統(tǒng)中自定義回收站路徑。我們將涵蓋GNOME、KDE Plasma桌面環(huán)境以及命令行方法。

GNOME桌面環(huán)境

  1. 安裝dconf-editor (如果未安裝): 使用終端執(zhí)行以下命令:

    sudo apt install dconf-editor
  2. 打開(kāi)dconf-editor: 在終端輸入:

    dconf-editor
  3. 導(dǎo)航至回收站設(shè)置: 在dconf-editor中,找到org -> gnome -> desktop -> trash路徑。

  4. 修改回收站路徑: 找到location鍵,雙擊并輸入自定義路徑,例如:file:///path/to/your/custom/trash。

  5. 應(yīng)用更改: 關(guān)閉dconf-editor,更改即生效。

KDE Plasma桌面環(huán)境

  1. 打開(kāi)系統(tǒng)設(shè)置: 通過(guò)開(kāi)始菜單或右鍵點(diǎn)擊桌面選擇“系統(tǒng)設(shè)置”。

  2. 導(dǎo)航至垃圾箱設(shè)置: 找到“存儲(chǔ)” -> “垃圾箱”設(shè)置。

  3. 修改回收站路徑: 在“位置”選項(xiàng)中,輸入自定義路徑,例如:file:///path/to/your/custom/trash。

  4. 應(yīng)用更改: 點(diǎn)擊“應(yīng)用”或“確定”保存更改。

命令行方法

對(duì)于命令行用戶(hù),可以通過(guò)編輯配置文件修改回收站路徑。

GNOME:

  1. 編輯配置文件: 使用nano編輯器打開(kāi)配置文件:

    nano ~/.config/dconf/user
  2. 添加或修改配置: 添加或修改以下內(nèi)容,將/path/to/your/custom/trash替換為你的自定義路徑:

    [org/gnome/desktop/trash] location='file:///path/to/your/custom/trash'
  3. 保存并退出: 按Ctrl+X,然后Y確認(rèn)保存,最后Enter退出。

KDE Plasma:

  1. 編輯配置文件: 使用nano編輯器打開(kāi)配置文件:

    nano ~/.config/plasma-org.kde.trashrc
  2. 添加或修改配置: 添加或修改以下內(nèi)容,將/path/to/your/custom/trash替換為你的自定義路徑:

    [Trash] Location=file:///path/to/your/custom/trash
  3. 保存并退出: 按Ctrl+X,然后Y確認(rèn)保存,最后Enter退出。

重要提示: 確保自定義路徑存在且具有正確的權(quán)限,以便系統(tǒng)能夠正確訪(fǎng)問(wèn)和使用該路徑作為回收站。

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊13 分享