---
title: "How to Send Files to the Trash Can in Linux with Gio Trash"
description: "When you run out of disk space or want to remove unnecessary files to increase server security, you may end up deleting a lot of files in a short period of time. If you're in the Linux terminal /..."
url: https://www.inmotionhosting.com/support/server/linux/send-files-to-trash-with-gio-trash/
date: 2020-06-03
modified: 2026-03-11
author: "InMotion Hosting Contributor"
categories: ["Linux"]
type: post
lang: en
---

# How to Send Files to the Trash Can in Linux with Gio Trash

When you [run out of disk space](https://www.inmotionhosting.com/support/product-guides/vps-hosting/running-out-of-disk-space-on-vps/) or want to remove unnecessary files to [increase server security](https://www.inmotionhosting.com/support/product-guides/vps-hosting/ways-to-harden-your-vps-hosting/), you may end up deleting a lot of files in a short period of time. If you're in the Linux terminal / [SSH](https://www.inmotionhosting.com/support/server/ssh/what-is-shell-access/), you'll likely use the [rm command](https://www.inmotionhosting.com/support/server/linux/rm-command/). But this permanently deletes files (excluding data recovery methods) and can result in you having to [restore from backup files](https://www.inmotionhosting.com/support/edu/cpanel/cpanel-backups/) if you delete the wrong file(s). The solution may already be on your machine.

The `gio`` trash` command will **send files to your trash can** for later review. It's pre-installed on many Linux operating systems (OSs) and the successor to `gvfsd``-trash`.

It's important to remember that `gio trash` sends files to `~/.local/share/Trash/files` instead of `~/.trash`, used on [cPanel managed](https://www.inmotionhosting.com/support/website/backup-and-restore/restore-trash/) servers.

The `.local/share/Trash` directory includes three directories:

- `info` stores deleted files' original location and deletion time
- `files` stores deleted files until it's emptied
- `expunged` may temporarily hold recently emptied trash

Below we cover how to [send files to the trash can](#trash) and [permanently delete files](#delete) with `gio`.

Try our [Cloud Server Hosting](https://www.inmotionhosting.com/cloud-vps) today and upgrade your disk space anytime without downtime.

## Send Files to Trash with gio trash

1. [Open your terminal](https://www.inmotionhosting.com/support/server/ssh/how-to-login-ssh/).
2. Move files to `.trash`: gio trash
3. View the trash in `.local/share/Trash/files`: gio list trash:// Or ls ~/.local/share/Trash/files
4. Empty the trash can: gio trash --empty

### man gio | grep trash

Below is the `man ``gio` trash information:

man gio | grep trash

trash
Sends files or directories to the "Trashcan". This can be a different folder depending on where the file is located, and not all file systems support this concept. In the common case that the file lives inside a users home directory, the trash folder is $XDG_DATA_HOME/Trash.

Note that moving files to the trash does not free up space on the file system until the "Trashcan" is emptied. If you are interested in deleting a file irreversibly, see the remove command.

Inspecting and emptying the "Trashcan" is normally supported by graphical file managers such as nautilus, but you can also see the trash with the command: gio list trash://.

Options
-f, --force
Ignore non-existent and non-deletable files.

--empty
Empty the trash.

Use `gio help trash` for short a short summary.

## Delete Files Permanently with gio remove

You can also permanently remove files with the `gio`` remove` command:

gio remove

Use the `-f` option to ignore non-existent and non-deletable files:

gio remove -f

The trash and delete options are also available in popular GUI applications.

![Confirm the delete File Manager](https://www.inmotionhosting.com/support/wp-content/uploads/2013/02/cpanel_plfix_PL_fix_Selection_40.png)*cPanel users have the File Manager to [move files to ~/.trash](https://www.inmotionhosting.com/support/edu/cpanel/delete-trash/) or [delete files](https://www.inmotionhosting.com/support/edu/cpanel/delete-trash/).*

![](https://www.inmotionhosting.com/support/wp-content/uploads/2020/06/linux-mint-trash-file.png)*Linux desktop file managers (e.g. [Thunar](https://docs.xfce.org/xfce/thunar/start) and [Nemo](https://github.com/linuxmint/nemo)) have options if you right-click files or select *Edit* from the top menu.*

What lesser known Linux commands do you know? Let us know in our [Community Support Center](https://www.inmotionhosting.com/support/questions/).
