linux 删除文件夹(删除文件夹命令)

懵懂先生 投稿文章linux 删除文件夹(删除文件夹命令)已关闭评论73阅读模式

文章源自略懂百科-http://wswcn.cn/94170.html

概述

在大多数情况下,我们在linux中删除文件和目录是通过rm命令,这些方法并不能永久、安全地从硬盘(或任何存储介质)中删除文件。文章源自略懂百科-http://wswcn.cn/94170.html

假设文件包含机密或机密内容,例如系统的用户名和密码,攻击者可以轻松恢复文件的已删除副本并访问这些文件 。文章源自略懂百科-http://wswcn.cn/94170.html

在本文中,我们分享一些用于在 Linux 中永久安全地删除文件的命令行工具。文章源自略懂百科-http://wswcn.cn/94170.html

一、Shred -覆盖文件以隐藏内容

1、安装软件包文章源自略懂百科-http://wswcn.cn/94170.html

yuminstallcoreutils-8.22-24.el7_9.2.x86_64-y文章源自略懂百科-http://wswcn.cn/94170.html

2、命令及参数选项文章源自略懂百科-http://wswcn.cn/94170.html

[root@192_168_209_128 ~]shred --helpUsage: shred [OPTION]... FILE...Overwrite the specifiedFILE(s) repeatedly,inorder to make it harderforeven very expensive hardware probing to recover the data.文章源自略懂百科-http://wswcn.cn/94170.html

Mandatory arguments tolongoptions are mandatoryforshortoptions too.
-f, --force change permissions to allow writingifnecessary
-n, --iterations=N overwrite N times instead of thedefault(3)
--random-source=FILEgetrandom bytesfromFILE
-s, --size=N shredthismanybytes(suffixes like K, M, G accepted)
-u, --remove[=HOW] truncate andremovefile after overwriting; See below
-v, --verbose show progress
-x, --exactdonot round file sizes up to the next full block;thisisthedefaultfornon-regular files
-z, --zeroadda final overwrite with zeros to hide shredding
--help displaythishelp and exit
--version output version information and exit文章源自略懂百科-http://wswcn.cn/94170.html

选项说明:文章源自略懂百科-http://wswcn.cn/94170.html

-z- 添加一个带有零的最终覆盖以隐藏切碎-v– 可以显示操作进度-u- 覆盖后截断和删除文件-n– 指定覆盖文件内容的次数(默认为 3)文章源自略懂百科-http://wswcn.cn/94170.html

3、示例文章源自略懂百科-http://wswcn.cn/94170.html

shred覆盖文件以隐藏其内容,也可以选择删除它。文章源自略懂百科-http://wswcn.cn/94170.html

$ shred -zvu -n5passwords.list文章源自略懂百科-http://wswcn.cn/94170.html

二、Wipe —在 Linux 中安全擦除文件

Linuxwipe命令可以安全地从磁存储器中擦除文件,从而无法恢复。文章源自略懂百科-http://wswcn.cn/94170.html

1、安装软件包文章源自略懂百科-http://wswcn.cn/94170.html

首先,您需要安装擦除工具,运行下面的相应命令:文章源自略懂百科-http://wswcn.cn/94170.html

$ sudo yuminstallwipe [OnRedHat based systems]文章源自略懂百科-http://wswcn.cn/94170.html

2、命令及参数选项文章源自略懂百科-http://wswcn.cn/94170.html

$wipe--help文章源自略懂百科-http://wswcn.cn/94170.html

选项:文章源自略懂百科-http://wswcn.cn/94170.html

-r- 告诉擦除递归到子目录-f- 启用强制删除和禁用确认-i- 显示删除过程的进度文章源自略懂百科-http://wswcn.cn/94170.html

3、示例文章源自略懂百科-http://wswcn.cn/94170.html

以下命令将销毁目录private下的所有内容。文章源自略懂百科-http://wswcn.cn/94170.html

$ wipe -rfiprivate/*文章源自略懂百科-http://wswcn.cn/94170.html

[文章源自略懂百科-http://wswcn.cn/94170.html

文章源自略懂百科-http://wswcn.cn/94170.html

三、Linux 安全删除工具包

Secure-delete是一个安全文件删除工具的集合,其中包含srm(secure_deletion) 工具,用于安全删除文件。文章源自略懂百科-http://wswcn.cn/94170.html

1、安装软件包文章源自略懂百科-http://wswcn.cn/94170.html

首先,您需要使用以下相关命令安装它:文章源自略懂百科-http://wswcn.cn/94170.html

$ sudo yuminstallsecure-delete[OnRedHat based systems]文章源自略懂百科-http://wswcn.cn/94170.html

2、命令及参数选项文章源自略懂百科-http://wswcn.cn/94170.html

$[root@192_168_209_128]srm --helpUsage: srm [OPTION]... [FILE]...
Overwrite and remove (unlink) the files. By defaultusethe35-pass Gutmann
methodtooverwrite files.文章源自略懂百科-http://wswcn.cn/94170.html

-d,--directory ignored (for compatability with rm(1))-f,--force ignore nonexistant files, never prompt-i,--interactive prompt before any removal-x,--one-file-system do not cross file system boundaries-s,--simple overwrite with single pass using 0x00 (default)-P,--openbsd overwrite with three passes like OpenBSD rm-D,--dod overwrite with 7 US DoD compliant passes-E,--doe overwrite with 3 US DoE compliant passes-G,--gutmann overwrite with 35-pass Gutmann method-C,--rcmp overwrite with Royal Canadian Mounted Police passes-r, -R,--recursive remove the contents of directories-v,--verbose explain what is being done-h,--help display this help and exit-V,--version display version information and exit文章源自略懂百科-http://wswcn.cn/94170.html

选项:文章源自略懂百科-http://wswcn.cn/94170.html

-f- 强制删除-r- 递归删除,删除目录及目录中的内容-v– 启用详细模式-z– 用零而不是随机数据擦除最后一次写入文章源自略懂百科-http://wswcn.cn/94170.html

3、示例文章源自略懂百科-http://wswcn.cn/94170.html

您可以使用srm工具在 Linux 系统上安全地删除文件或目录,如下所示。文章源自略懂百科-http://wswcn.cn/94170.html

$ srm -vzprivate/*文章源自略懂百科-http://wswcn.cn/94170.html

[文章源自略懂百科-http://wswcn.cn/94170.html

文章源自略懂百科-http://wswcn.cn/94170.html

文章源自略懂百科-http://wswcn.cn/94170.html

懵懂先生
  • 本文由 发表于 2023年2月10日 15:08:30
  • 转载请注明:http://wswcn.cn/94170.html
投稿文章

厄尔尼诺现象(厄尔尼诺暖冬凉夏的原因)

近期,关于今冬冷暖的话题大家议论纷纷,在很多的文章中,我们都发现了厄尔尼诺这个名字,它究竟是什么意思呢?为何却能左右我国冬季的冷暖,很多村民为何要谈厄色变呢?今天小编就带你看一些,这厄尔尼诺与我国冬季...
投稿文章

垃圾处理方法(垃圾怎么处理)

什么是垃圾分类? 垃圾分类是对垃圾收集处置传统方式的改革,是对垃圾进行有效处置的一种科学管理方法。通过分类投放、分类收集、分类运输、分类处置,把有用物资从垃圾中分离出来重新回收、利用,变废为宝。 为什...
投稿文章

榴莲的功效与作用、禁忌和食用方法 女性晚上吃榴莲的好处

榴莲是热带水果,原产马来西亚。东南亚一些国家种植较多,榴莲在泰国最负有盛名,被誉为水果之王。 榴莲虽然营养丰富,但是它却属于两极分化较严重的水果,喜欢吃榴莲的人会觉得榴莲一点都不臭,吃起来非常美味,不...
投稿文章

ps图层蒙版的使用方法是什么(ps剪贴蒙版怎么用)

ps剪贴蒙版教程(ps图层蒙版的使用步骤)你知道吗?蒙版是PS学习中最重要的技能之一。本教程中将和大家分享ps剪贴蒙版教程(ps图层蒙版的使用步骤)的10个有关蒙版的使用技巧,新手小白总觉得蒙版似乎是...