简体   繁体   English

rm删除了哪个目录?

[英]Which directory rm removed?

I need to remove all files in public_html/ 我需要删除public_html /中的所有文件

I login as user name admin 我以用户名admin登录

I perform: 我执行:

cd /home/admin/web/mydomain.com/public_html/
rm /*

I thought it will remove all files in public_html/ but linux ask me to remove directories: 我以为它将删除public_html/中的所有文件,但是linux要求我删除目录:

/backup /bin /boot /data /dev /etc /home /initrd.img /initrd.img.old /lib /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /swapfile /sys /tmp /usr /var /vmlinuz /vmlinuz.old

Which directory I have removed? 我删除了哪个目录?

Thanks 谢谢

edit Thanks @Aguardientico I have removed / directory. 编辑谢谢@Aguardientico我已经删除了/目录。 Since I perform rm /* using user instead of root , then I haven't removed anything, right? 由于我是使用user而不是root来执行rm /*的,所以我还没有删除任何内容,对吗?

Thanks 谢谢

one way to remove files is the command rmdir to remove the directory of the public_html which will remove all the files 删除文件的一种方法是命令rmdir删除public_html的目录,该目录将删除所有文件

cd /home/admin/web/mydomain.com/
rmdir public_html 

so you go to the directory where the file is and then you delete it and it will remove all files in that directory and the folder itself, then if you need the folder you can just remake it. 因此,您转到文件所在的目录,然后将其删除,它将删除该目录中的所有文件以及文件夹本身,然后,如果需要该文件夹,则可以重新制作它。
here is a link http://www.computerhope.com/unix/urmdir.htm 这是链接http://www.computerhope.com/unix/urmdir.htm

It all depends if you are the Admin user on the server. 这完全取决于您是否是服务器上的管理员用户。 But typically public_html/ is located in /var/www/ 但通常public_html/位于/var/www/

$ cd /home/admin/web/mydomain.com/public_html/
$ ls
$ rm *

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM