rm (rm-safe) is an alternative to shell /bin/rm, which supports pin
or unpin
operation to protect your data.
rm help
, display help inform pin
, pin directories to protect them
rm pin
: pin current directory
rm pin [target]...
: pin targets, if target is file, pin directory of target
rm pin -r [target]...
: pin targets recursivelyrm unpin
, unpin directories to unprotect them
rm unpin
: likerm pin
rm unpin [target]...
: likerm unpin [target]
rm unpin -r [target]...
: likerm unpin -r [target]...
rm [options] [target]...
, absolutely works like shell/bin/rm
, why? I use exec.Command('/bin/rm', args) to fullfill the deletion task.
go install github.com/hitzhangjie/rm
go install
will install rm
to $GOPATH/bin
, please make sure $GOPATH/bin
appears before /bin, /usr/bin
in $PATH
.