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.
So I am forced to use a GUI to delete the folder (and its contents) of that file. Which is slow....slow....slow....
I mean, when I compiled a huge software, and I want to remove it (such as the CVS version of wine), I have make uninstall (or checkinstall) but if I want to remove the source entirely, its painsaking on a commandline. And commandline is faster at deleting files.
I mean, I WANT TO DELETE EVERYTHING INSIDE THE DIRECTORY.
And rmdir doesn't have an "empty directory" option. Thats stupid too.
I just want to get rid of everything, can't it do that for me, on a commandline, without typing the name of all 1000 files and folders inside the folder I want to remove?!!!
Thus I conclude, the writers of such programs are doing us a great inconvenience.
No, I want to clear the contents of the directory (empty it) then remove the directory. I could be pleased with that.
But instead, in order to do so, I have to cd to each directory, rm each file invididually, then rmdir that directory...tiring!
I want the programs to empty the directory! Can't THEY do that?!
But yay, I decided to use make clean to minimise the file to 42 MB, (from 900 MB).
I am still annoyed though, for other stuff in the future. What if its not a source, but just as huge?
Thus the writers of rm are inflexible and stupid for failing to add an option to just simply empty the directory and erasing all the inodes the directory contains.
"." and ".." are special directory names. "." is the current directory. You can't delete it because your current directory would then be invalid.
".." is the parent directroy, the one that contains the current directory. You can't delete it for the same reason... If you deleted the directory that holds the current directory, the current directory would have to be deleted.
Besides, neither "." nor ".." is really there. Can you erase something that doesn't exist?
These two directories have nothing to do with your real problem of not being able to delete a directory with files in it. If you want more info on rm, you can look at the manual page with "man rm", or the simple help with "rm --help".
If you STILL feel something is wrong with the utility, maybe you should contact the authors. I'm sure they get right on it.
Quote:
AUTHOR
Written by Paul Rubin, David MacKenzie, Richard Stallman, and Jim Mey-
ering.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
Originally posted by ranger_nemo "." and ".." are special directory names. "." is the current directory. You can't delete it because your current directory would then be invalid.
".." is the parent directroy, the one that contains the current directory. You can't delete it for the same reason... If you deleted the directory that holds the current directory, the current directory would have to be deleted.
I meant something like "./.", not the parent or current directory itself....
Originally posted by natalinasmpf No, I want to clear the contents of the directory (empty it) then remove the directory. I could be pleased with that.
But instead, in order to do so, I have to cd to each directory, rm each file invididually, then rmdir that directory...tiring!
I don't understand the 2 step method (remove files first, then remove dir), this can be done in 1 step using rm:
All, including the directory itself and all underlaying dirs/files: rm -rf <name_dir>
All files and underalying dirs, but not the dir itself $ rm -rf <name_dir>/*
Remove files in <name_dir> and not the underlaying directories (and files in them): $ rm <name_dir>/*
Remove files and 'dot'-files in <name_dir> and not the underlaying directories (and files in them): $ rm <name_dir>/* <name_dir>/.*
For more complex removals use find and give the output to rm.
Being forced to use options isn't necessarly a bad thing. Some distros add an alias so that you are forced into interactive mode. It can be very difficult to recover files once deleted. Have you ever read a post where someone was logged a root and by accident did a rm -rf on the wrong directory?
If you feel that typing a -R is too time comsuming then create just create an alias with whatever options you desire.
i hate man pages for 2 reasons, 1) its teh stupidest name i ever heard to call somthing and most importnat # 2) i don wanna install some stupid other program jsut to do what a normal text viewer can do (example : less)
but to this rm -fvr //* thingy, (mhm i dare anyone to try to enter that into teh promt and see if it dleetd all files starting with // in teh curent firectory (same logic apiles here as in .. or . just be glad it dont do it and find a way around it (for some reason i cant get ech to make files starting with a .
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
[QUOTE]Originally posted by SciYro
[B]i hate man pages for 2 reasons, 1) its teh stupidest name i ever heard to call somthing and most importnat # 2) i don wanna install some stupid other program jsut to do what a normal text viewer can do (example : less)
1. man page: Abbr. manual page
2. less simply shows and paginates the contents of a file for viewing without having to open it, besides less is good for more than just text files
just pipe the output of other commands into less to paginate thier output
for instance:
last | less (last 'pipe' less) paginates the output of the last command for easier viewing
dmesg | less shows and paginates the kernel boot up messages
toe | less shows all the termcap enteries in human readable form and paginates them
last,less, and toe are 3 commands that have output that unless you are mr. data from star trek have to be either paginated or '>'ed into a file and opened with a text editor, personally i prefer piping those ouptputs through less myself, as it's one step instead of two
so please, do a little research before just calling something 'stupid'
At the end of the day without putting words in the posters mouth (which I obviosuly don't have any right to do) I think more than anything they were just letting off steam after a bit of frustation...hell I'd be in the electric chair and well fried by now going by some of the posts I've made before
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.