CCooles 2020-03-05 18:11 采纳率: 100%
浏览 661
已采纳

rm -rf /tmp之后无法在此目录下创建文件

初学求教,

[root@StudyLinux tmp]# ls
1.txt  3.txt  5.txt   ks-script-JKp08e            vmware-root_796-2991202916  vmware-root_978-2957649101
2.txt  4.txt  as.txt  vmware-root_785-4282170929  vmware-root_845-4021653450  yum.log
[root@StudyLinux tmp]# rm -rf /tmp/
[root@StudyLinux tmp]# ls
[root@StudyLinux tmp]# touch {a..d}.txt
touch: cannot touch ‘a.txt’: No such file or directory
touch: cannot touch ‘b.txt’: No such file or directory
touch: cannot touch ‘c.txt’: No such file or directory
touch: cannot touch ‘d.txt’: No such file or directory
[root@StudyLinux tmp]# 

  • 写回答

1条回答 默认 最新

  • 七秒记忆的咸鱼 2020-03-12 22:04
    关注

    因为你把当前目录和上级目录都删除了,你可以回到根目录看看,这个时候的tmp目录已经没有了
    每个目录下都有一个隐藏的.和..两个目录,表示当前目录和上级目录,你的rm -rf /tmp/ 是把这个目录下的所有文件全部删除也包括了那两个隐藏的目录

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?