You are not logged in.


Friday, April 8th 2005, 2:41pm

trash command line

Is there a way to send a file to the kde 3.4 trash bin from the command line?



Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message


Saturday, April 9th 2005, 4:50pm

According to this there is a commandline program called ktrash

And you can use kfmclient as well as David points out :D

Qt/KDE Developer
Debian User


Saturday, April 9th 2005, 5:02pm

Great. Here's a trash script for lazy folks like me.

# Move files to trash:/

kfmclient move "$@" trash:/


Friday, January 6th 2006, 1:40am

Work in progress.

KTrash in filrenameutils-1.6 supports the KDE-3.4 trash can.
It's still mostly untested though.


Sunday, April 23rd 2006, 2:59am

KDE trash command line utility

The KTrash utility can also be used to powerfully removed
(and then restore) files with "find". For example, to delete all the kbounce
game files:

KTrash -e
find /opt/kde -name *bounce* | xargs KTrash

You can then save the ~/.local/share/Trash directory
and optionally restore it at a later time, restoring all the
deleted files with

KTrash -R



Posts: 948

Location: Eindhoven

Occupation: Software Engineer

  • Send private message


Sunday, April 23rd 2006, 10:26am

A little bit off topic, but still about scripting and trash: some time ago I wrote a script to automatically remove all files in the trash older than a certain amount of days.…-trash-bin.html

It might be interesting :)
Bram Schoenmakers
KDE Netherlands (