我希望命令完全切碎文件夹/目录(可能在文件夹/目录内)的内容。另外请解释该命令。
shred或secure-delete?
shred 并没有您想像的那样有效,因为现代文件系统和硬件不会覆盖适当的数据,而是记录更改或将其移动以进行损耗平衡。相关:unix.stackexchange.com/questions/27027/...
我希望命令完全切碎文件夹/目录(可能在文件夹/目录内)的内容。另外请解释该命令。
shred或secure-delete?
shred 并没有您想像的那样有效,因为现代文件系统和硬件不会覆盖适当的数据,而是记录更改或将其移动以进行损耗平衡。相关:unix.stackexchange.com/questions/27027/...
Answers:
secure-delete。srm -r pathname删除文件夹和文件。默认设置是用于覆盖38(!!!)次的覆盖,这是极端的overkill恕我直言(请参阅此处的更多信息)。
就我的用途而言,我只希望单次传递随机数据,所以我使用srm -rfll pathname。
如果要在GUI中为文件和文件夹创建右键单击选项,请使用gnome-actions调用如下脚本:
#!/bin/bash
if dialog=`zenity --window-icon=warning --question --title="Secure Delete" --no-wrap --text="Are you sure you want to securely delete:\n\n $1\n\nand any other files and folders selected? File data will be overwritten and cannot be recovered."`
then /usr/bin/srm -fllrv "$@"| zenity --progress --pulsate --text="File deletion in progress..." --title="Secure Delete" --auto-close
fi
如果您想要更多的偏执设置,请确保修改以上脚本。
-f fast (and insecure mode): no /dev/urandom, no synchronize mode。 -l lessens the security (use twice for total insecure mode)。你能解释这两件事吗?默认情况下38个覆盖将如何影响'38'值。以及为什么要l两次-rfll
(frist) -l: only two passes,(second) -l: only one pass。对于其他人,-f: fast (Non-secure random bits)和-r: recursive。我也强烈建议-v: verbose。我还建议在一个screen实例中运行它,它可能需要花费大量时间处理大量数据。
对于不是目录的文件,这是一种更简单的方法,而不是-exec shred -u {} \;类型的方法:
cd to your directory.
然后
find . -type f -print0 | xargs -0 shred -fuzv -n 48
这确实将48递归传递到您cd进入的当前目录。
希望这会有所帮助。
切细仅适用于文件。您需要先将dir / subdirs中的文件切碎,然后再删除目录。尝试
find [PATH_TO_DIR]
并确保您只看到要删除的文件
find [PATH_TO_DIR] -exec shred -u {} \;
然后用
rm -rf [PATH_TO_DIR]
{} \;?在其他地方我也看到了与您相同的命令,但这'{}' \;两者之间有什么区别?
shred命令的作用,那么您就会找到答案。