Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to delete a directory by linux

Shulou Source: shulou.com Published: 2022-05-31 19:03:29 09月21日 Update

This article mainly explains "linux how to delete a directory", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "linux how to delete a directory" bar!

Linux delete a directory method: 1, open the terminal command window; 2, by executing the "rm-rf folder name" command to delete the specified directory.

This article operating environment: linux5.9.8 system, Dell G3 computer.

How does linux delete a directory?

Linux quickly deletes a directory:

Command line rm-rf folder name

Extended data:

1. The Linux rm command is used to delete a file or directory.

2. Syntax: rm [options] name...

3. Parameters:-I ask for confirmation one by one before deletion;-f delete directly even if the original file attribute is read-only, without confirming one by one;-r delete the directory and the following files one by one.

4. Example: you can directly use the rm command to delete files. If you delete a directory, you must match the option "- r", for example: # rm-r homework rm: do you want to delete the directory "homework"? Y

5. Delete all files and directories in the current directory. Command line: rm-r *

6. Once the file is deleted by the rm command, it cannot be restored, so you must use this command with great care.

Thank you for your reading, the above is the content of "how to delete a directory in linux". After the study of this article, I believe you have a deeper understanding of how to delete a directory in linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Directories commands files learning content names folders files read-only parameters instances that is attributes ideas situations articles methods more environment computer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info vpn Apple Docker