linux 文件后缀 问号,linux – 如何修复所有问号作为权限的目录

我正在使用CentOS 7并尝试列出目录的内容但不能.当我尝试列出内容时,我得到以下输出:

[entpnerd@myhost ~]$ls -ali /data/sharedlogs/otherhost/

ls: cannot access /data/sharedlogs/otherhost/vcs: Not a directory

total 12

2361284 drwxr-xr-x 4 root root 4096 Sep 26 14:40 .

2359297 drwxr-xr-x 6 root root 4096 Apr 26 17:41 ..

2362573 drwxr-xr-x 2 root root 4096 Mar 22 2017 tkr

? d????????? ? ? ? ? ? vcs

输出声明我的目录vcs是“Not a directory”,即使它应该是,因为这是以前记录过文件的地方.此外,文件权限位现在都是问题标记,所有者也是,并且(莫名其妙地)inode ID.

如何让文件系统再次将我的目录识别为目录?

在尝试了下面概述的所有内容之后,我看到的唯一前进路径是确保磁盘备份并运行fsck(如this forum所示)或者可能只是格式化整个安装.希望我找到一个更简单,不那么激烈的解决方案.

我试过的一些事情:

> sudo:我试过运行sudo ls但输出没有差别.

> rm:我试过删除vcs把它放回去但没有运气.我用sudo和没有尝试过这个,但也没有运气.奇怪的是,当我尝试sudo rm时,它声明是一个目录.我也试过rm同时使用-r和-d开关,也没有运气.我从rm命令尝试获得的输出是:

[entpnerd@myhost ~]$rm /data/sharedlogs/otherhost/vcs

rm: cannot remove ‘/data/sharedlogs/otherhost/vcs’: Not a directory

[entpnerd@myhost ~]$sudo rm /data/sharedlogs/otherhost/vcs

rm: cannot remove ‘/data/sharedlogs/otherhost/vcs’: Is a directory

[entpnerd@myhost ~]$sudo rm -r /data/sharedlogs/otherhost/vcs

rm: cannot remove ‘/data/sharedlogs/otherhost/vcs’: Is a directory

[entpnerd@myhost ~]$rm -r /data/sharedlogs/otherhost/vcs

rm: cannot remove ‘/data/sharedlogs/otherhost/vcs’: Not a directory

[entpnerd@myhost ~]$rm -rd /data/sharedlogs/otherhost/vcs

rm: cannot remove ‘/data/sharedlogs/otherhost/vcs’: Not a directory

[entpnerd@myhost ~]$sudo rm -rd /data/sharedlogs/otherhost/vcs

rm: cannot remove ‘/data/sharedlogs/otherhost/vcs’: Is a directory

> inode ID:我尝试通过inode删除(如this answer to a similar question所示),但我也没有运气,因为从上面的ls命令的输出可以看出,vcs目录没有inode ID.

>非ASCII字符:在帖子“How to Delete the Undeletable Directory”中,目录具有非ASCII字符.我从xxd输出中看到的情况也不是这样:

[entpnerd@myhost ~]$ls -l /data/sharedlogs/otherhost/ | xxd

ls: cannot access /data/sharedlogs/otherhost/vcs: Not a directory

0000000: 746f 7461 6c20 340a 6472 7778 722d 7872 total 4.drwxr-xr

...

0000040: 3f3f 3f3f 3f20 3f20 3f20 2020 203f 2020 ????? ? ? ?

0000050: 2020 2020 203f 2020 2020 2020 2020 2020 ?

0000060: 2020 3f20 7663 730a ? vcs.

> lsattr:正如类似问题“Why can’t I delete this file as root?”所示,我尝试使用lsattr命令,但没有运气:

[entpnerd@myhost ~]$lsattr /data/sharedlogs/otherhost/

-------------e-- /data/sharedlogs/otherhost/tkr

/data/sharedlogs/otherhost/vcs: Not a directory

[entpnerd@myhost ~]$lsattr /data/sharedlogs/otherhost/vcs

lsattr: Not a directory while trying to stat /data/sharedlogs/otherhost/vcs

[entpnerd@myhost ~]$sudo lsattr /data/sharedlogs/otherhost/vcs

[sudo] password for entpnerd:

lsattr: Not a directory while trying to stat /data/sharedlogs/otherhost/vcs

[entpnerd@myhost ~]$sudo chmod -R g+x /data/sharedlogs/otherhost/vcs

[sudo] password for entpnerd:

chmod: cannot access ‘/data/sharedlogs/otherhost/vcs’: Not a directory

[entpnerd@myhost ~]$sudo chmod -R u+x /data/sharedlogs/otherhost/vcs

chmod: cannot access ‘/data/sharedlogs/otherhost/vcs’: Not a directory

[entpnerd@myhost ~]$sudo chmod -R a+x /data/sharedlogs/otherhost/vcs

chmod: cannot access ‘/data/sharedlogs/otherhost/vcs’: Not a directory

任何帮助将不胜感激.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值