简体   繁体   中英

Which directory rm removed?

I need to remove all files in public_html/

I login as user name 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:

/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. Since I perform rm /* using user instead of root , then I haven't removed anything, right?

Thanks

one way to remove files is the command rmdir to remove the directory of the public_html which will remove all the files

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

It all depends if you are the Admin user on the server. But typically public_html/ is located in /var/www/

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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