This ruby script will securely erase files and folders recursively in Linux. You may want to add a action to run this script to the context menu of Nautilus using nautilus-actions.
#
# Shreds files and folders recursively. Code released under MIT license.
NUMBER_OF_PASSES = 20
def shred_files_and_folders(path)
if File.directory?(path)
files = Dir.entries(path)
files.delete_if {|x| x == "." or x == ".." }
files.each do |f|
if File.directory?(path + '/' + f)
shred_files_and_folders(path + '/' + f)
else
puts ` shred -v -z -u -n#{NUMBER_OF_PASSES} #{path + '/' + f}`
end
end
Dir.rmdir(path)
else
puts ` shred -v -z -u -n#{NUMBER_OF_PASSES} #{path}`
end
end
ARGV.each do |path|
shred_files_and_folders(path)
end
Comments
need to double check the option arguments and try to get it to speed up shreding of large files