Linux如何自定義回收站路徑

Linux如何自定義回收站路徑

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

GNOME桌面環境

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

    sudo apt install dconf-editor
  2. 打開dconf-editor: 在終端輸入:

    dconf-editor
  3. 導航至回收站設置: 在dconf-editor中,找到org -> gnome -> desktop -> trash路徑。

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

  5. 應用更改: 關閉dconf-editor,更改即生效。

KDE Plasma桌面環境

  1. 打開系統設置: 通過開始菜單或右鍵點擊桌面選擇“系統設置”。

  2. 導航至垃圾箱設置: 找到“存儲” -> “垃圾箱”設置。

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

  4. 應用更改: 點擊“應用”或“確定”保存更改。

命令行方法

對于命令行用戶,可以通過編輯配置文件修改回收站路徑。

GNOME:

  1. 編輯配置文件: 使用nano編輯器打開配置文件:

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

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

KDE Plasma:

  1. 編輯配置文件: 使用nano編輯器打開配置文件:

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

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

重要提示: 確保自定義路徑存在且具有正確的權限,以便系統能夠正確訪問和使用該路徑作為回收站。

? 版權聲明
THE END
喜歡就支持一下吧
點贊13 分享