shell-safe-rm

授权协议 MIT License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 秦涵映
操作系统 跨平台
开源组织
适用人群 未知
 软件概览
 _______  _______  _______  _______         ______    __   __
|       ||   _   ||       ||       |       |    _ |  |  |_|  |
|  _____||  |_|  ||    ___||    ___| ____  |   | ||  |       |
| |_____ |       ||   |___ |   |___ |____| |   |_||_ |       |
|_____  ||       ||    ___||    ___|       |    __  ||       |
 _____| ||   _   ||   |    |   |___        |   |  | || ||_|| |
|_______||__| |__||___|    |_______|       |___|  |_||_|   |_|

A much safer replacement of bash rm with ALMOST FULL features of the origin rm command.

Initially developed on Mac OS X, then tested on Linux.

Using safe-rm, the files or directories you choose to remove will move to $HOME/.Trash instead of simply deleting them. You could put them back whenever you want manually.

If a file or directory with the same name already exists in the Trash, the name of newly-deleted items will be ended with the current date and time.

Supported options

For those implemented options, safe-rm will act exactly the same as the original rm command

-i, --interactive

-f, --force

-r, -R, --recursive, --Recursive

-v, --verbose

--

Combined short options are also supported, such as

-rf, -riv, etc

Usual Installation

Add an alias to your ~/.bashrc script,

alias rm='/path/to/bin/rm.sh'

and /path/to is where you git clone shell-safe-rm in your local machine.

Permanent Installation

If you have NPM (node) installed (RECOMMENDED):

npm i -g safe-rm

Or normally with make:

make && sudo make install
# and enjoy

For those who have no make command:

sudo sh install.sh

Installing safe-rm will put safe-rm in your /bin directory. In order to usesafe-rm, you need to add an alias to your ~/.bashrc script and in all yourscurrently open terminals, like this:

alias rm='safe-rm'

After installation and alias definition, when you execute rm command in the Terminal, lines of below will be printed:

> rm
safe-rm
usage: rm [-f | -i] [-dPRrvW] file ...
     unlink file

which helps to tell safe-rm from the original rm.

Uninstall

First remove the alias line from your ~/.bashrc file, then

npm uninstall -g safe-rm

Or

make && sudo make uninstall

Or

sudo sh uninstall.sh
  • 首先,都知道在linux中“rm -rf /”命令,今个咱就破它。 第一步 下载 [root@xuegod1 safe-rm-0.12]# wget https://launchpad.net/safe-rm/trunk/0.12/+download/safe-rm-0.12.tar.gz 第二部 解压 [root@xuegod1 safe-rm-0.12]# tar -xf safe-rm-0.

  • 方案一: rm -rf 删除目录时要判断目录 #!/bin/bashwork_path=pwd #如果目录不为空,才执行删除操作if [ ${work_path} != “” ];then rm -fr ${work_path}/fi 在执行删除目录操作前,先判断要删除的目录是否为空,不为空才执行删除操作。 方案二: Shell 脚本指定 set -u执行脚本的时候,如果遇到不存在的变量,Bash

  • https://www.cnblogs.com/pengfy/p/12108054.html pyinstaller报错urllib3.packages.six.moves pre-safe-import-module hook failed, needs fixing. 在使用pyinstaller打包时,出现了以下错误: urllib3.packages.six.moves pre-safe-

  • 前言 safe-rm 是一款用来替代不安全 rm 的开源软件,可以在 /etc/safe-rm.conf 文件中配置保护名单,定义哪些文件不能被 rm 删除,可用于防止执行 rm -rf 命令导致文件被误删的发生。 安装 safe-rm 工具 # 下载文件 # wget https://launchpadlibrarian.net/188958703/safe-rm-0.12.tar.gz #

  • 转载之:https://www.cnblogs.com/langdashu/p/5404595.html 一、缘由:   最近看到这则新闻,很是悲伤,因为我最近也在用ansible;然而这一错误源自Ansible上糟糕的代码设计,这款Linux实用工具被用于在多台不同服务器上自动执行脚本。   开发者解释到,实际参数应该是“rm -rf {foo}/{bar}”,foo和bar是脚本中动态传递的两

  • 1、下载 (1)下载 [root@node0 ~]# wget https://launchpad.net/safe-rm/trunk/0.12/+download/safe-rm-0.12.tar.gz (2)解压缩 [root@node0 ~]# tar -zxvf safe-rm-0.12.tar.gz -C /opt safe-rm-0.12/ safe-rm-0.12/INSTALL s

  • 1.下载safe-rm safe-rm实际上就是一个工具,一个可以指定那些目录文件不被误删除的工具 官网地址:https://launchpad.net/safe-rm/+download wget https://launchpad.net/safe-rm/trunk/0.12/+download/safe-rm-0.12.tar.gz 2.替换系统的rm命令 # 解压 shell> tar

 相关资料
  • safe-rm 是一个安全的文件删除工具,当因为误输入要删除某个系统目录时,该工具会阻止这种行为。

  • Lua是一种为 Sandboxing (沙箱) 准备语言。 Safe Lua 让您轻松地使用Lua代码的沙箱创建和许多有趣的用途。 Lua is a language well prepared for sandboxing. Safe Lua lets you easily create and use sandboxes for Lua code for numerous interesting purposes.

  • Password Safe是一个在国外拥有几百万用户的免费开源软件,软件同样采用开源的Twofish加密算法代码合成开发。该软件由一群致力于为公众开发免费应用软件 的国外民间组织提供。软件有多种平台版本和不同功能组合分类,根据不同版本其中包含了全世界的各种先进加密算法,如:PGP、AES、DES、IDEA、 Yubikey等。 该软件为其组织主要功能版本,提供用户保存日常各领域用户密码和提供强大的

  • 简单直接的的 Koa2 的脚手架 迅速开发 - 自动热重启服务 + 测试驱动开发模式 + 重置数据库(by cli) 生产就绪 - 有node 和 npm 马上可以部署,不用安裝任何东西 从众- 80%人会做的设计决定(design decision)和80%人会使用的库(library) 结构简单 - routes + MVC + 中间件(Middleware) 没有魔法 - 可由app.js

  • Walter Webcoder has a great idea for a portal site: The Web Arithmetic Page. Surrounded by all sorts of cool mathematical links and banner ads that will make him rich is a simple central frame, contai

  • react-native-safe-area-context A flexible way to handle safe area, also works on Android and Web! Getting started npm install react-native-safe-area-context You then need to link the native parts of t