Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions
User Name
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.


  Search this Thread
Old 08-23-2006, 02:32 PM   #1
LQ Newbie
Registered: Aug 2006
Posts: 5

Rep: Reputation: 0
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????
Old 08-23-2006, 02:52 PM   #2
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
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.
Old 08-23-2006, 02:57 PM   #3
LQ Newbie
Registered: Aug 2006
Posts: 5

Original Poster
Rep: Reputation: 0
how to delete system files ?? what if i don't wanna delete dir but only all files including system files and hidden files?????????
Old 08-23-2006, 03:01 PM   #4
Senior Member
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
you will get "." and "..", those are created with a directory. so if you want to remove that delete the dir itself
Old 08-23-2006, 09:47 PM   #5
LQ Veteran
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
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.
Old 08-28-2006, 12:21 AM   #6
Registered: Apr 2004
Location: NJ,US
Distribution: Debian Sid
Posts: 33

Rep: Reputation: 15
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 ..


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hidden files? sonic04002 Linux - Newbie 2 11-09-2005 02:48 PM
home directory files gone, hidden files remain Grasshopper Linux - Security 12 04-10-2005 09:23 PM
hidden files Alwyn Linux - Newbie 2 01-27-2005 01:20 AM
Hidden Files Alien18 Linux - Newbie 4 08-12-2004 10:38 PM
M$ CD w/ Hidden files???? trey85stang Linux - Newbie 3 05-04-2004 10:00 PM > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 08:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration