-   Linux - Distributions (
-   -   How to delete hidden files??? (

kabucek 08-23-2006 01:32 PM

How to delete hidden files???
How to delete all files in directory including hidden files???
I know command
rm -rfv * <- will delete all files & show effect
but when i ls -a i've got still "." & ".." files
How to delete those files????

pljvaldez 08-23-2006 01:52 PM

You can't.

"." refers to "this directory", ".." refers to "the directory above this one" (hence cd ..). The only way to get rid of them is to delete the directory.

kabucek 08-23-2006 01:57 PM

how to delete system files ?? what if i don't wanna delete dir but only all files including system files and hidden files?????????

w3bd3vil 08-23-2006 02:01 PM

you will get "." and "..", those are created with a directory. so if you want to remove that delete the dir itself

J.W. 08-23-2006 08:47 PM

Just to reiterate, you cannot delete the "single dot" or "double dot" files. Those exist in every directory, and as already mentioned, they refer to "this directory itself" and the parent directory, respectively.

To delete any other system files, you can do so as root, however, I would advise against this, because depending on which system file(s) you delete, you could render your system unusable.

dinojerm 08-27-2006 11:21 PM

By default, * expands to all files except hidden ones (beginning with .)
If you want to delete those hidden files (except for . and .. of course), you can use "rm .*" or "rm * .*"

Also, if you don't like the . and .. in the "ls -a" listing, you can use "ls -A" to list "almost-all" entries, which doesn't show . or ..

All times are GMT -5. The time now is 11:48 AM.