Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the linux delete folder command

Shulou Source: shulou.com Published: 2022-06-02 01:33:48 09月28日 Update

Xiaobian to share with you what the linux delete folder command is, I hope you read this article after the harvest, let us discuss it together!

Linux Delete Folder Command

Linux delete directory is very simple, many people are still accustomed to using rmdir, but once the directory is not empty, they fall into deep distress, now use rm -rf command.

Direct rm is OK, but you need to add two parameters-rf, that is: rm -rf directory name

Delete directories, files rm(remove)

Function Description: Delete files or directories.

Grammar:

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

Supplementary note: execute rm command to delete files or directories. If you want to delete directories, you must add parameter "-r", otherwise only files will be deleted by default.

Parameters:

-d or-directory directly delete the hard connection data of the directory to be deleted to 0, delete the directory.

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

-i or-interactive Ask users before deleting existing files or directories.

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

-v or-verbose shows instruction execution.

1. delete folder

de>rm -rf fileNamede>

- Delete folder instance:

rm -rf /var/log/httpd/access

The/var/log/httpd/access directory and all files and folders under it will be deleted.

Need to remind is: use this rm-rf time must be extra careful, linux does not recycle bin

2. delete files

de>rm -f fileNamede>

Be careful when using rm-rf, linux has no recycle bin

After reading this article, I believe you have a certain understanding of what the linux delete folder command is. If you want to know more about it, welcome to pay attention to the industry information channel. Thank you for reading!

Tags: File directory folder command parameter recycle bin instruction time article processing distress two middle function name subdirectory subdirectory finished instance data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info NVidia MariaDB Huawei OPPO Reno