rip/README.org

77 lines
3.3 KiB
Org Mode
Raw Normal View History

2016-08-31 01:12:21 +00:00
* rip (Rm ImProved)
2016-10-04 11:55:38 +00:00
[[https://crates.io/crates/rm-improved][https://img.shields.io/crates/v/rm-improved.svg]]
2016-10-17 11:18:48 +00:00
[[https://travis-ci.org/nivekuil/rip][https://travis-ci.org/nivekuil/rip.svg?branch=master]]
2016-10-04 11:55:38 +00:00
2016-10-22 06:56:27 +00:00
=rip= is a command-line deletion tool focused on safety, ergonomics, and performance. It does /not/ implement the xdg-trash spec.
2016-10-22 12:16:54 +00:00
Deleted files get sent to the graveyard (=/tmp/.graveyard= by default) under their absolute path, giving you a chance to recover them. No data is overwritten. If files that share the same path are deleted, they will be renamed as numbered backups.
2016-08-31 01:12:21 +00:00
2016-10-22 12:16:54 +00:00
=rip= is made for lazy people. If any part of the interface could be more intuitive, please open an issue or pull request.
2016-08-31 01:12:21 +00:00
2016-09-03 09:41:15 +00:00
** Installation
2016-10-18 07:06:19 +00:00
Get a binary [[https://github.com/nivekuil/rip/releases][release]] or run =cargo install rm-improved= with a nightly compiler.
2016-09-03 09:41:15 +00:00
** Usage
2016-08-31 01:12:21 +00:00
#+BEGIN_EXAMPLE
USAGE:
2016-10-16 23:50:12 +00:00
rip [FLAGS] [OPTIONS] [TARGET]...
2016-08-31 01:12:21 +00:00
FLAGS:
2016-10-22 06:58:59 +00:00
-d, --decompose Permanently deletes (unlink) the entire graveyard
2016-09-04 14:01:00 +00:00
-h, --help Prints help information
2016-10-22 06:58:59 +00:00
-i, --inspect Prints some info about TARGET before prompting for action
-s, --seance Prints files that were sent under the current directory
2016-09-04 14:01:00 +00:00
-V, --version Prints version information
2016-08-31 01:12:21 +00:00
OPTIONS:
--graveyard <graveyard> Directory where deleted files go to rest
2016-10-22 06:58:59 +00:00
-r, --resurrect <target> Undo the last removal by the current user, or specify some file(s) in the graveyard. Combine with -s to restore everything printed by -s.
2016-08-31 01:12:21 +00:00
ARGS:
2016-10-16 23:50:12 +00:00
<TARGET>... File or directory to remove
2016-08-31 01:12:21 +00:00
#+END_EXAMPLE
2016-10-22 12:16:54 +00:00
Basic usage -- same as rm
2016-10-22 06:56:27 +00:00
#+BEGIN_EXAMPLE
$ rip file1 hamilton/ dir1/
#+END_EXAMPLE
Print files that were deleted from under the current directory
#+BEGIN_EXAMPLE
$ rip -s
/tmp/.graveyard/home/jack/file1
/tmp/.graveyard/home/jack/dir1
/tmp/.graveyard/home/jack/hamilton
#+END_EXAMPLE
Restore the last deleted file
#+BEGIN_EXAMPLE
$ rip -r
Returned /tmp/.graveyard/home/jack/dir1 to /home/jack/dir1
#+END_EXAMPLE
Resolve name conflicts
#+BEGIN_EXAMPLE
$ touch file1
$ rip file1
$ rip -s
/tmp/.graveyard/home/jack/file1
/tmp/.graveyard/home/jack/hamilton
/tmp/.graveyard/home/jack/file1.1
#+END_EXAMPLE
2016-10-22 12:16:54 +00:00
-r also takes the path of a file in the graveyard
2016-10-22 06:56:27 +00:00
#+BEGIN_EXAMPLE
2016-10-22 08:35:34 +00:00
$ rip -r /tmp/.graveyard/home/jack/file1.1
2016-10-22 06:56:27 +00:00
Returned /tmp/.graveyard/home/jack/file1.1 to /home/jack/file1
#+END_EXAMPLE
Combine -r and -s to restore everything printed by -s
#+BEGIN_EXAMPLE
$ rip -sr
2016-10-22 12:16:54 +00:00
Returned /tmp/.graveyard/home/jack/hamilton to /home/jack/hamilton
2016-10-22 06:56:27 +00:00
Returned /tmp/.graveyard/home/jack/file1 to /home/jack/file1.1
#+END_EXAMPLE
2016-10-17 00:01:16 +00:00
*** Notes
- In general, a deletion followed by a =--resurrect= should be idempotent.
- You probably shouldn't alias =rm= to =rip=. =rm -r= is two characters longer, anyway.
2016-10-22 12:16:54 +00:00
- If you want to put the graveyard somewhere else (like =~/.local/share/Trash=), you have two options, in order of precedence:
1. Alias =rip= to =rip --graveyard ~/.local/share/Trash=
2. Set the environment variable =$GRAVEYARD= to =~/.local/share/Trash=.
This can be a good idea because if the graveyard is mounted on an in-memory filesystem, (as /tmp is in Arch Linux), deleting large files can quickly fill up your RAM. It's also much slower to move files across filesystems, although the delay should be minimal with an SSD.
- A deletion log is kept in =.record=, found in the top level of the graveyard.