linux - Unix 命令 rmdir 什么时候适合使用?

标签 linux macos unix terminal console

<分区>

我正在尝试使用 Unix 命令 rmdir 删除目录,但我不断收到一条消息:

pwd
/Users/jona/Documents/Unix-Practice
$ rmdir Unix-Practice
rmdir: Unix-Practice: No such file or directory

我也是这样做的,看看是否需要在要删除的目录之上:

$ cd ..
$ pwd
/Users/jona/Documents
$ rmdir Unix-Practice
rmdir: Unix-Practice: Directory not empty

我是否使用不当的命令?

我正在从本指南中学习 http://cli.learncodethehardway.org/book/ex7.html它告诉我使用 rmdir

最佳答案

您的目录似乎包含一些文件,当目录为空时使用rmdir

From the man page of rmdir

  • rmdir - 删除空目录
  • 如果 DIRECTORY 为空,则删除它们。

使用: rm -r Unix-Practice 删除带文件的目录

关于linux - Unix 命令 rmdir 什么时候适合使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21422717/

相关文章:

linux - ValueError : Cannot feed value of shape (50, ) 对于张量 u'Placeholder_1 : 0', which has shape ' (? , 10)'

c - 如何确定是否启用了 CONFIG_FANOTIFY_ACCESS_PERMISSIONS?

linux - 检查 Node 版本不返回任何内容

ios - osx 上的 ‘I Space’ 和 ‘D Space’ 是什么以及它们之间的区别

macos - 如何在 Mac 应用程序中检索 Wi-Fi 热点列表?

linux - 包含条件和参数的表 ?在哪里?

unix - Windows 中的 Win 32 API 等 UNIX 的 API 是什么?

linux - 通过串行端口发送一些无符号整数时出错(teensy -> raspi)

ios - iOS 沙盒的具体限制

linux - Linux中如何获取进程的页表内容?