在linux上删除包含子文件夹和文件的文件夹 [英] Delete folder that contain subfolders and files on linux

查看:33
本文介绍了在linux上删除包含子文件夹和文件的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含文件和文件夹的文件夹,我需要在一个命令中删除所有文件,但是如果我确定要删除它,我不会询问每个文件,有任何命令吗?

I have a folder that contain files and fodlers i need to delete then all in one command, but without asking me for each file if i'm sure that i want to delete it, there is any command for this ?

推荐答案

你需要递归删除那个文件夹,

You need to delete that folder recursively,

rm -r folder-name

来自 rm --help,

-r, -R, --recursive   remove directories and their contents recursively

这篇关于在linux上删除包含子文件夹和文件的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆