SRM is a secure replacement for rm. Unlike the standard rm, it overwrites the data in the target files before unlinking them. This prevents command-line recovery of the data by examining the raw block device. It may also help frustrate physical examination of the disk, although it’s unlikely that it can completely prevent that type of recovery. It is, essentially, a paper shredder for sensitive files.

srm is ideal for personal computers or workstations with Internet connections. It can help prevent malicious users from breaking in and undeleting personal files, such as old emails. Because it uses the exact same options as rm, it is simple to use. Just subsitute it for rm whenever you want to destroy files, rather than just unlinking them.

srm removes each specified file by overwriting, renaming, and truncating it before unlinking. This prevents other people from undeleting or recovering any information about the file from the command line. By default srm uses 35 passes to overwrite the file’s contents. If this seems overkill you can use use the –dod, –doe, –openbsd, –simple option which use less passes. If you specify more than one option (of those listed above) they are executed in the order shown above.

You can use it to overwrite block devices. The device node is not removed after overwriting. This feature is available on Linux. Files with multiple hard links will be unlinked but not overwritten.



srm [-dflrvz] file1 file2 etc.


        -d  ignore the two dot special files "." and "..".
	-f  fast (and insecure mode): no /dev/urandom, no synchronize mode.
	-l  lessens the security (use twice for total insecure mode).
	-r  recursive mode, deletes all subdirectories.
	-v  is verbose mode.
	-z  last wipe writes zeros instead of random data.


cyborg@cyborg:~$ srm -v -f a.pdf
Wipe mode is secure (38 special passes)
Wiping a.pdf ************************************** Removed file a.pdf ... Done

Leave a reply


We're are building as a community and a team. Be a part of it.


©2018 Ztrela Knowledge Solutions Pvt. Ltd

Log in with your credentials

Forgot your details?