RIP2
Saving private files
Credit: https://github.com/MilesCranmer/rip2
Shashank Sharma is a superhero whose superpower is rescuing deleted files. He has many useful tools in his utility belt, such as Rip2.
OUR EXPERT
Shashank Sharma is a trial lawyer in New Delhi and an avid Arch user. He’s been writing about open source software for 20 years, and lawyering for 10.
Deleting files is easy, and while rescuing them is possible, the process is quite involved and D not foolproof. GUI users have the luxury of recovering files from the trash folder, but this isn’t available for the CLI out of the box.
Written in Rust and released under the GPL3 licence, Rip2 is a replacement of the rm command. In the utility’s terminology, all deleted files are sent to the graveyard, usually /tmp/graveyard-$USER, from where you can recover them with ease. This is distinct from the xdg-trash spec, which is what defines how files in the GUI are deleted and relegated to the trash folder.
You need Cargo, Rust’s package manager, to install the latest release of Rip2, as the project isn’t available in the software repositories of most popular desktop distros. The command cargo install --locked rip2 will do the trick. You can run brew install rip2 instead if your system is configured for Homebrew packages.
Easy delete
Depending on your distro configuration, the graveyard – the directory where deleted files are kept – may vary. Run rip graveyard to check the defined location: $ rip graveyard /tmp/graveyard-linuxlala