Summary of how to completely delete Linux files

  

We all know how to delete system files under Linux, but sometimes it is not complete, how to completely delete files? The following small series will introduce you to the method of completely deleting Linux files, let's learn together.

linux delete directory is simple, many people still used rmdir, but once the directory is not empty, it plunged into deep distress, now use rm -rf command.

Direct rm is fine, but add two parameters -rf ie: rm -rf directory name

delete directory, file rm(remove)

Description: Delete files or directories.

Syntax: rm [-dfirv][--help][--version][file or directory. . .]

Additional note: Execute the rm command to delete the file or directory. If you want to delete the directory, you must add the parameter ”-r”, otherwise the default will only delete the file.

Parameters:

-d or –directory Delete the hard-wired data of the directory to be deleted directly into 0, and delete the directory.

-f or –force Forces the deletion of files or directories.

-i or –interactive Ask the user before deleting the existing file or directory.

-r or -R or –recursive Recursive processing, all files and subdirectories under the specified directory are processed together.

-v or –verbose Shows the execution of the instruction.

1 Deleting a folder

de "rm -rf fileNamede"

- Deleting a folder instance:

rm -rf /var/log/httpd /access

will delete the /var/log/httpd/access directory and all files and folders under it

Need to be reminded: be careful when using this rm -rf , linux does not have a recycle bin

2 delete files

de "rm -f fileNamede"

When using rm -rf must be very careful, linux does not have a recycle bin

Deleting files other than the specified file
Prev12Next page Total 2 pages

Copyright © Windows knowledge All Rights Reserved