Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does anyone know of a quicker and easier way to remove files and (especially) directories other than just manually going in and rm * within a directory, then later just rmdir * once all is cleared out ???
Be careful using this command. If you accidently run rm -rf /, it will delete everything.
Quote:
From Rashkae:
Important trick. -rf is a very dangerous switch, escpecially if used as root.. For safety, you should always put the -rf *after* the directory name. Example ' rm /home/here -rf ' [Enter]. God have mercy on your soul if your finger accidentally brushes the Enter key right when you have ' rm -rf / ' typed.
rythomas, the rmdir command only removes empty directories. rm <directory_name> -rf will remove the files, subdirectories, and the directory that holds the all files and subdirectories.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
use a GUI., such as kde or gnome, the graphical file manager will allow you to delete the files with a 'trash can' like windows or mac is should be easier and safer than rm -rf
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.