The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to delete a file through SAMBA mcubitt Windows & DOS: Issues & Discussions 3 08-26-2008 07:52 PM
Unable to view files in a particular directory under /opt its.simron Linux 1 05-21-2008 10:59 AM
unable to delete a file arunkumar_mca UNIX for Dummies Questions & Answers 13 12-06-2006 07:04 PM
unable to delete file for permission problem sabyasm UNIX for Dummies Questions & Answers 4 02-26-2006 08:55 PM
when I try to run rm on multiple files I have problem to delete files with space umen UNIX for Dummies Questions & Answers 1 09-20-2005 04:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-22-2008
sydney2008 sydney2008 is offline
Registered User
  
 

Join Date: Aug 2008
Location: Sydney, Australia
Posts: 26
Unable to delete files

I have more than 1 million files (No directories). rm -rf * did not work.

How do i delete all these files at a stretch in a single command?
  #2 (permalink)  
Old 08-22-2008
replytoshishir replytoshishir is offline
Registered User
  
 

Join Date: May 2006
Location: Bangalore
Posts: 23
did you tried combining "ls" command with "rm"
  #3 (permalink)  
Old 08-22-2008
replytoshishir replytoshishir is offline
Registered User
  
 

Join Date: May 2006
Location: Bangalore
Posts: 23
offcourse you should have permissions.. is there any error message displayed..
  #4 (permalink)  
Old 08-22-2008
palsevlohit_123 palsevlohit_123 is offline
Registered User
  
 

Join Date: Aug 2008
Location: India-Chennai
Posts: 120
Thumbs up

find . -type f -exec rm {} \;

NOTE: it will delete all the files including the subdirectories.
  #5 (permalink)  
Old 08-22-2008
replytoshishir replytoshishir is offline
Registered User
  
 

Join Date: May 2006
Location: Bangalore
Posts: 23
rm -f should be fine.. no need of "r" option.. as this is for directory
  #6 (permalink)  
Old 08-22-2008
sydney2008 sydney2008 is offline
Registered User
  
 

Join Date: Aug 2008
Location: Sydney, Australia
Posts: 26
I have logged in as root & have necessary permission (755), rm -f & "ls" command with "rm"
did not work as well.

Checking this .. find . -type f -exec rm {} \;
  #7 (permalink)  
Old 08-25-2008
agasamapetilon agasamapetilon is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 67
Why don't you try:
Code:
rm /directory/*
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:21 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0