无法从命令行删除目录

时间:2015-10-04 01:50:14

标签: shell command-line command command-line-interface

我一定是做错了。我正在尝试删除“坐骑”#39;目录及其所有内容。任何想法??

dfmmalaw@portfolio-php-:~ $ ls 
lib/  mounts/  workspace/

dfmmalaw@portfolio-php-:~ $ rm -rf mounts
rm: cannot remove ‘mounts/deanfriedlandcom2’: Is a directory

dfmmalaw@portfolio-php-:~ $ umount mounts/deanfriedlandcom2
umount: /home/ubuntu/mounts/deanfriedlandcom2 is not in the fstab (and you are not root)

2 个答案:

答案 0 :(得分:0)

试试这个

在下面的mount命令的结果中查找你的mount记录,在你的情况下它将包含/ deanfriedlandcom2。

示例记录: /home/dfmmalaw/downloads/camera_software.iso on / deanfriedlandcom2 type iso9660(ro)

sudo su
cd /home/ubuntu/
mount 
umount /home/ubuntu/downloads/camera_software.iso mounts/deanfriedlandcom2 #umount <filesystem> <mount point>
rm -rfd mounts

答案 1 :(得分:0)

确保已卸载安装点,然后删除目录:

使用sudo

sudo umount mounts

sudo rm -rf mounts

或者可以使用su

user @ host $ su

user @ host#umount mounts

user @ host#rm -rf mounts