linux系统删除可确信文件(防误删除文件),操作方式

先引用一折事件:

 

如果你100% 确定 非操作不可否则会死 ,那么建议用echo 重定向 以及shred命令来替代了,务必清醒状态下使用!!!(此时就可以襟止使用 rm -rf 的指令操作)

【例】直接给出命令:

$ echo > yourBigFileToEmpty 

$ shred  -uzvn1 yourfile
[xxxx@salt test222]$ ls 

./netconfig

[xxxx@salt test222]$ cp ../myetc/netconfig  ./

[xxxx@salt test222]$ shred  -uzvn1 netconfig
shred: netconfig: pass 1/2 (random)...
shred: netconfig: pass 2/2 (000000)...
shred: netconfig: removing
shred: netconfig: renamed to 000000000
shred: 000000000: renamed to 00000000
shred: 00000000: renamed to 0000000
shred: 0000000: renamed to 000000
shred: 000000: renamed to 00000
shred: 00000: renamed to 0000
shred: 0000: renamed to 000
shred: 000: renamed to 00
shred: 00: renamed to 0
shred: netconfig: removed
[xxxx@salt test222]$ ls
[mstadm@salt test222]$

[xxx@salt test222]$ find ./netconfig -exec shred -uzvn1 {} \;
shred: ./netconfig: pass 1/2 (random)...
shred: ./netconfig: pass 2/2 (000000)...
shred: ./netconfig: removing
shred: ./netconfig: renamed to ./000000000
shred: ./000000000: renamed to ./00000000
shred: ./00000000: renamed to ./0000000
shred: ./0000000: renamed to ./000000
shred: ./000000: renamed to ./00000
shred: ./00000: renamed to ./0000
shred: ./0000: renamed to ./000
shred: ./000: renamed to ./00
shred: ./00: renamed to ./0
shred: ./netconfig: removed

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值