简体   繁体   English

如何使用rm -rf从目录中删除文件?

[英]How to delete files from directory using rm -rf?

I have directory exam with 2 files in it. 我有2个文件的目录考试。 I need to delete files but permission is denied. 我需要删除文件,但权限被拒绝。 Even ![rm -rf][1] command can't delete these files. 甚至![rm -rf][1]命令也无法删除这些文件。 I logged in as a root user. 我以root用户身份登录。

# rm -rf exam_a
# rm -rf exam_b

在此处输入图片说明

在此处输入图片说明

From root user check attributes of files 从root用户检查文件的属性

# lsattr 

if you notice i or a 如果您注意到ia

# man chattr
# chattr -i [filename]
# chattr -a [filename]

if it doesn't work reboot system. 如果不起作用,请重新启动系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 仅RM -rf文件 - RM -rf Files only Java删除文件/目录,等同于linux“ rm -rf / tmp / garbagedir *” - Java delete file/directory equivalent of linux “rm -rf /tmp/garbagedir*” 如何在没有rm -rf sledgehammer的情况下删除单个git存储库克隆? - How to delete a single git repository clone, without the rm -rf sledgehammer? rm -rf 失败时如何删除 .git 目录? - How to remove .git directory when rm -rf fails? 如何使用终端命令删除Linux上名为“-rf”的目录? - How to delete a directory on linux with name "-rf" using terminal command? 如何在Linux中使用rm命令删除除一组目录之外的所有文件? - How to delete all files apart from a set of directories using rm command inlinux? 在脚本中捕获 rm -rf (mac/linux) - 通过密码保护 - 不允许删除文件 - Catching rm -rf (mac/linux) in script - protecting via password - not letting delete files 如何在Linux上清除c ++中的目录内容(基本上,我想做'rm -rf <directorypath> / *' - How to clear directory contents in c++ on Linux (basically, i want to do 'rm -rf <directorypath>/*' 在 Linux PowerShell 和 Linux ZD574D4BB40C84861791A69466 中使用“rm -rf” - Using 'rm -rf' in Linux PowerShell and Linux bash 如何确定运行rm -rf时释放的空间量 - How to determine the amount of space that comes free when running rm -rf
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM