Skip to content

What is sdel Linux command?

The sdel command in Linux is used to securely delete files and directories by overwriting them multiple times to prevent data recovery. It helps protect sensitive information from being accessed by unauthorized users.

Terminal window
sdel [options] [file/directory]
OptionDescription
-rRecursively delete
-fForce delete (no prompts)
-vVerbose mode (show details)
-hHelp (display usage information)
ParameterDescription
file/directoryThe file or directory to be deleted.
Terminal window
sdel file.txt

Deletes the file named “file.txt”.

Terminal window
sdel -r directory

Removes all files and subdirectories in the specified directory recursively.

Terminal window
sdel file1.txt file2.txt file3.txt

Deletes multiple files named “file1.txt”, “file2.txt”, and “file3.txt”.

Terminal window
sdel -s confidential.txt

Overwrites the content of the file “confidential.txt” before deleting it, making it unrecoverable.

Terminal window
sdel -t

Permanently deletes all files in the trash can, instead of moving them to the trash directory.

To use the sdel command in bash, execute the following command:

Terminal window
sdel --option <value>

What are the available options with the sdel command?

Section titled “What are the available options with the sdel command?”

The sdel command in Linux offers various options for secure file deletion. You can explore these options by typing:

Terminal window
sdel --help

How can I securely delete a specific file using sdel?

Section titled “How can I securely delete a specific file using sdel?”

To securely delete a specific file with sdel, use the following command format:

Terminal window
sdel --file <filename>

Can I use sdel to delete multiple files at once?

Section titled “Can I use sdel to delete multiple files at once?”

Yes, you can delete multiple files at once using sdel in Linux by providing a list of filenames as arguments. Here is an example:

Terminal window
sdel --file file1.txt file2.txt file3.txt

How can I securely delete a directory with sdel?

Section titled “How can I securely delete a directory with sdel?”

To securely delete a directory and its contents with sdel, use the following command format:

Terminal window
sdel --dir <directory_path>

Is there a way to verify the secure deletion process with sdel?

Section titled “Is there a way to verify the secure deletion process with sdel?”

You can enable the verification option to confirm the secure deletion process with sdel. Include the --verify flag in your command like this:

Terminal window
sdel --file <filename> --verify

How do I change the number of overwrites for secure deletion in sdel?

Section titled “How do I change the number of overwrites for secure deletion in sdel?”

To set a specific number of overwrites for secure deletion in sdel, you can use the --repeats option followed by the desired number. Here is an example:

Terminal window
sdel --file <filename> --repeats 10

Can I force the deletion of files without any confirmation using sdel?

Section titled “Can I force the deletion of files without any confirmation using sdel?”

If you want to force the deletion of files without any confirmation prompts, you can use the --force option in your sdel command. For example:

Terminal window
sdel --file <filename> --force
  • Securely delete files or directories
  • Shred sensitive information before disk disposal or sharing
  • Ensure that deleted data cannot be recovered through file recovery tools