LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-24-2005, 12:37 AM   #1
Karthikeyan Gurusamy
LQ Newbie
 
Registered: Dec 2005
Posts: 14

Rep: Reputation: 0
Deleting unwanted files from any directory without reading each


Hello guys,

Can anybody tell me how to delete unwanted files in any directory (like /home) without visiting each file.

Thanking You

Regards,

Karthikeyan Gurusamy
 
Old 12-24-2005, 12:59 AM   #2
DarkElf109
Member
 
Registered: Dec 2005
Location: Phoenix, AZ
Distribution: Ubuntu, Debian, Gentoo
Posts: 43

Rep: Reputation: 15
To delete all files in a directory, use:

rm *

To delete all files AND all subdirectories, use:

rm -rf *

BE CAREFUL! This cannot be reversed! There's no recycle bin! (I learned this the hard way -_-)
 
Old 12-24-2005, 02:08 AM   #3
Karthikeyan Gurusamy
LQ Newbie
 
Registered: Dec 2005
Posts: 14

Original Poster
Rep: Reputation: 0
unwanted files deleting

hi

My another doubt is "If there are thousands of files avail in a directory, i can delete unwanted files without visit each file using rm- command" and i shouldn't delete important files. what can i do in this situation? help me in this situation.
 
Old 12-24-2005, 02:48 AM   #4
DarkElf109
Member
 
Registered: Dec 2005
Location: Phoenix, AZ
Distribution: Ubuntu, Debian, Gentoo
Posts: 43

Rep: Reputation: 15
You can do it all in one command, with

rm File1 File2 File3 FileN...
 
  


Reply


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
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 07:05 AM
deleting all *.m3u files in a directory+subdir? minm Linux - Newbie 5 10-12-2004 04:31 PM
can anyone tell me hoy to lock unwanted attached files in sendmail? jastorqu Linux - Networking 0 06-17-2004 01:05 PM
Deleting a directory... closet geek Linux - General 7 07-09-2003 07:25 AM
Deleting unwanted programmes... Ewen Linux - General 33 12-27-2002 12:17 AM


All times are GMT -5. The time now is 10:38 AM.

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