Coder Social home page Coder Social logo

nov1n / rm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a14m/rm

0.0 3.0 0.0 220 KB

workaround script to make terminal `rm` work with system Trash

Home Page: http://artmees.github.io/rm/

License: GNU General Public License v2.0

Shell 100.00%

rm's Introduction

rm

Since you've reached this page, I assume you did the same bad thing I did before. After using rm very_important_file and later realize that you can't retrieve that file.

I'm not sure how to retrieve that file, but I came to write this to avoid doing the same stupid mistake ever again.

You can thank me later :D

This is a custom script used to avoid deleting files forever and instead files will be moved to /Users/user_name/.Trash folder

This script only works if you invoked it directly from the terminal rm file

it doesn't work if any script used rm some_file or if you used rm in other scripts

and this is done for your own safety, but if you need it to work with other scripts, please feel free to contact me and I'll instruct you on how to enable that.


Install

sudo cp rm.sh /usr/local/bin/rm

you might need to restart the terminal or run source ~/.bashrc or source ~/.bash_profile

Uninstall

sudo rm /usr/local/bin/rm

you might need to restart the terminal or run source ~/.bashrc or source ~/.bash_profile

please make sure that local/bin PATH before /bin PATH

add export PATH="/usr/local/bin:$PATH" to .bash_profile or .bashrc to achive this

Usage

rm [OPTION]...FILE...

/bin/rm [OPTION]...FILE... to use the system rm for special cases this script doesn't cover

###Options

option desc.
-h,--help display this help text and exit.
--version output version information and exit.
-r, -R, --recursive move the directories and their content to the Trash folder.
-f, --forever remove the directories and their content permanently (will use the system rm).

Bugs

Please report found bugs to https://github.com/artmees/rm/issues

COPYRIGHT

Copyright (C) 2013, Ahmed Abdel Razzak. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see http://www.gnu.org/licenses/.

rm's People

Contributors

lalo avatar

Watchers

James Cloos avatar Robert Carosi avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.