Linux command
srm 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Securely delete file
srm [file.txt]
Delete directory recursively
srm -r [directory/]
Simple overwrite (faster)
srm -s [file.txt]
Medium security (7 passes)
srm -m [file.txt]
Maximum security (38 passes)
srm -z [file.txt]
Verbose output
srm -v [file.txt]
Force delete
srm -f [file.txt]
说明
srm (secure rm) deletes files by overwriting their contents before unlinking, making data recovery significantly more difficult than with standard rm. It offers multiple security levels: simple mode (-s) performs a single overwrite pass for speed, medium mode (-m) uses 7 passes based on the DoD 5220.22-M standard, and the default Gutmann mode (-z) performs 38 passes with various patterns designed to defeat magnetic force microscopy. The tool handles recursive directory deletion with -r and supports force mode (-f) to skip confirmation prompts. File names are also overwritten before deletion to prevent recovery of filenames from directory entries.
参数
- -r, -R
- Recursive delete.
- -s
- Simple overwrite.
- -m
- Medium (7 passes).
- -z
- Gutmann (38 passes).
- -f
- Force, no prompt.
- -v
- Verbose.
- -l
- Reduce security for speed.
- -x
- One filesystem only.
FAQ
What is the srm command used for?
srm (secure rm) deletes files by overwriting their contents before unlinking, making data recovery significantly more difficult than with standard rm. It offers multiple security levels: simple mode (-s) performs a single overwrite pass for speed, medium mode (-m) uses 7 passes based on the DoD 5220.22-M standard, and the default Gutmann mode (-z) performs 38 passes with various patterns designed to defeat magnetic force microscopy. The tool handles recursive directory deletion with -r and supports force mode (-f) to skip confirmation prompts. File names are also overwritten before deletion to prevent recovery of filenames from directory entries.
How do I run a basic srm example?
Run `srm [file.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r, -R do in srm?
Recursive delete.