Commit c13acda7 authored by notklaatu's avatar notklaatu

Merge branch 'patch-1' into 'master'

Update README.md

See merge request !2
parents 284decb1 f21c2e0f
Trashy
======
Get trashy! A [mostly] Freedesktop-compliant rubbish bin interface for the shell written entirely in BASH.
Get trashy!: A **mostly** Freedesktop-compliant rubbish bin interface for the shell, written entirely in BASH.
http://slackermedia.info/trashy
Introduction
The sane `rm` intermediary
-----------------
Hi! right now you're looking at trashy, the sane `rm` intermediary.
This means that you've probably just done the unthinkable:
accidentally rm'd a superImportantFile by accident and immediately
thereafter started cursing God, UNIX, GNU, computers, and yourself.
Hi! If you're looking at [**trashy**](http://slackermedia.info/trashy) right now, you've probably just accidentally rm'd a superImportantFile by accident. You're cursing God, UNIX, GNU, computers, and yourself. While there's no hope for your already deleted file — that's gone, sorry—with `trashy`, you'll never have to go through that ever again!
Never fear. There is hope.
Well, not for your deleted file -- that's gone. Sorry. But if you use
`trashy`, you'll never have to go through that ever again!
`Trashy` is a simple shell script that enables you to restore superImportantFile simply and painlessly. Just type:
trash --restore foo
Usage
--------
and 'foo' is put back where it belongs.
Trashy is a simple shell script that introduces the idea of a trashcan
for the command line. Meaning that you can issue this command:
`Trashy` also serves as a trashcan for the command line. Issue this command:
trash foo bar
and the files 'foo' and 'bar' will be moved to your system trash.
or...
and `trashy` will move the files 'foo' and 'bar' to your system trash. Or type:
trash foo\ bar
and the file 'foo bar' will be moved to your system trash.
to move the file 'foo bar' to your system trash.
Simple as that.
When you're really, *really* sure that you want to nuke everything in your trash out of existence, issue the command:
Do you need that file back? Restore it with:
trash --empty
trash --restore foo
and `trashy` will empty your system trash.
and 'foo' is put back where it belongs.
When you're really *really* sure that everything in your Trash wants
to be nuked out of existence, then issue the command:
Why trashy?
-----------------
trash --empty
The `rm` command doesn't account for human error. Even if you like your UNIX to be
responsive and obedient, you'll still make mistakes. Trashy offers a buffer between you and deleted-file disasters.
and your system trash is emptied.
`Trashy` is BASHy, meaning that it's very portable; anything
that can run BASH can run it. You can easily install it on GNU Linux, freeBSD, and netBSD. It's also been
tested on Solaris and Open Solaris families, and even Mac (obviously
not Freedesktop-compliant, so features are missing) OS.
Projects similar to `trashy` do exist. One, [trash-cli](https://github.com/andreafrancia/trash-cli), uses Python and offers some
really neat and fancy features. Check it out if you're on a Linux box,
or if you don't mind a bit of set-up on non-Free Desktop UNIX systems.
System Trash
---------------
Trashy defines a *system trash* on Linux, BSD, and Solaris-based
`Trashy` defines a *system trash* on Linux, BSD, and Solaris-based
operating systems in accordance to the Open Desktop standard:
~/.local/share/Trash
On systems that do not use a graphical desktop or chooses not to
follow the Open Desktop standard, trashy tries to conform with what
is available. If all else fails, ``$HOME/.trash`` is used.
Because `trashy` leverages the Open Desktop standard, you can use it
alongside the usual Trash. Files you add to your trash with `trashy` go
to the same place as files you add to your trash via drag-and-drop on your desktop.
Since trashy leverages the Open Desktop standard, you can use trashy
alongside your usual Trash. File you add to your trash with trashy go
to the same place as files you add to your trash by dragging and
dropping on your desktop. It's all talking the same language.
On systems that do not not to follow the Open Desktop standard or that use a graphical desktop, `trashy` tries to conform with what
is available. If all else fails, it uses ``$HOME/.trash``.
Aliases
-----------
Most of us had `rm` beat into our heads early on, so getting out of
Many of us had `rm` beat into our heads early on, so getting out of
the habit of using it is actually really hard. If you find yourself
using `rm` in spite of trashy, you can just `alias rm='trashy'` in
your `.bashrc` file. This works quite well, in truth; and if you ever
using `rm` in spite of `trashy`, you can `alias rm='trashy'` in
your `.bashrc` file. This works quite well. And if you ever
want to override your alias, just use:
\rm foo
......@@ -87,53 +80,30 @@ or
Simple as that.
But until your muscle memory gets used to the idea that it's going to
be typing 'trash' instead of 'rm' when you want to delete a file, the
Until you get used to typing 'trash' instead of 'rm' when you want to delete a file, the
alias helps.
Removing the Alias
--------------------
Once you're used to using `rm` to delete permanently,
and trashy to move to a trash bin, just delete the alias from your `.bashrc` file.
Why trashy?
-----------------
The `rm` command doesn't account for human error. I like my UNIX to be
responsive and obedient as much as anyone, but sometimes I make
mistakes. Trashy offers a buffer between you and thermo nuclear war.
Trashy is BASHy, meaning that it's really really portable; anything
that can run BASH can run trashy. It can be installed easily on (and
is actively used on) GNU Linux, freeBSD, and netBSD. It has also been
tested on Solaris and Open Solaris families, and even Mac (obviously
not Freedesktop-compliant, so features are missing) OS.
It's simple, but it works well and it works on lots of systems.
Similar projects do exist. The one I know about uses Python and has some
really neat and fancy features. Check it out if you're on a Linux box
or if you don't mind a bit of set-up on non Free Desktop UNIX systems.
https://github.com/andreafrancia/trash-cli
Once you've gotten used to using `rm` to permanently delete something,
and using `trashy` to move to a trash bin, delete the alias from your `.bashrc` file.
Bugs
-----
I've ironed a lot of them, actually. Trashy has gotten a lot better
since its original implementation. I am sure there are many bugs that
could be revealed under the right testing circumstances, so give it a
go and let me know what you find. I can't promise I'll fix them
`Trashy` has improved substantially since its original implementation, but surely new bugs will emerge under the right testing circumstances. Give it a
go and if you find one, please report it. I can't promise I'll fix bugs
immediately, but they'll definitely make my list.
More features are still planned; notably, better handling of files
that are not in one's home folder (that is, do not copy file to local
filesystem to "trash" it; use a hidden .trash dir on the remote file
system instead, or at least provide this option).
What's Next: Features
----------------------
The top-priority plan is to provide better handling of files not in one's home folder—that is, do not copy file to local
filesystem to "trash" it, but use a hidden .trash dir on the remote file
system (or at least provide this option).
I can generally be contacted via klaatu at the domain of
member dot fsf dot org.
Contact
--------
Please email klaatu at the domain of member dot fsf dot org.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment