linux delete folder command

藏色散人
Release: 2019-06-06 09:15:12
Original
4828 people have browsed it

linux delete folder command

Linux delete folder command

Deleting a directory in Linux is very simple. Many people are still accustomed to using rmdir, but once If the directory is not empty, you will be in deep trouble. Now use the rm -rf command.

Just rm directly, but you need to add two parameters -rf, namely: rm -rf directory name

Delete directories and files rm(remove)

Function Description: Delete files or directories.

Syntax:

rm [-dfirv][--help][--version][文件或目录...]
Copy after login

Supplementary instructions: Execute the rm command to delete files or directories. If you want to delete a directory, you must add the parameter "-r", otherwise the default is only Files will be deleted.

Parameters:

-d or –directory Directly delete the hard link data of the directory to be deleted to 0 and delete the directory.

-f or –force Forcefully delete files or directories.

-i or –interactive Ask the user before deleting existing files or directories.

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

-v or –verbose Display the instruction execution process.

1. Delete the folder

de>rm -rf  fileNamede>
Copy after login

-Delete the folder instance:

rm -rf /var/log/httpd/access
Copy after login

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

need to be reminded: be extra careful when using this rm -rf, Linux does not have a recycle bin

2. Delete files

de>rm -f  fileNamede>
Copy after login

Be extra careful when using rm -rf, Linux does not have a recycle bin

Recommended video tutorials: "Linux Tutorial"

The above is the detailed content of linux delete folder command. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!