The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remove help removing to files wereyou UNIX for Dummies Questions & Answers 3 12-27-2007 07:44 PM
Remove the older files Prasandha UNIX for Dummies Questions & Answers 1 10-17-2006 04:03 AM
how to remove files with a date justintime Shell Programming and Scripting 5 09-10-2006 10:50 PM
How to remove files with zero lenght GNMIKE UNIX for Dummies Questions & Answers 2 09-08-2005 07:20 PM
remove some files on a condition.. ST2000 Shell Programming and Scripting 4 08-27-2002 10:26 PM

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 06-25-2002
Nisha Nisha is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chennai, India
Posts: 110
Question remove files

Hi,

How do i remove all the files that are present in the directory.. I know a way of doing this..that is by using *.* .. But my directory has executables or some files without extensions... So they are not getting deleted. What do i do to remove all of them?

Thanks,
Nisha
  #2 (permalink)  
Old 06-25-2002
ladwig
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Hi,
it depends on what kind of user your are, what permission you've got. Root can delete without no problems. Commad rm -f *.* deletes.
  #3 (permalink)  
Old 06-25-2002
killerserv's Avatar
killerserv killerserv is offline Forum Advisor  
Unix Predator
  
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
rm -r *.* can be used too. If its your folder and you have access on it chmod and change the permission first.
  #4 (permalink)  
Old 06-25-2002
Nisha Nisha is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chennai, India
Posts: 110
Red face

Hi,

I also tried rm -f *.*..but in vain..it isn't deleting. how do i see what permissions i have got????

-Nisha
  #5 (permalink)  
Old 06-25-2002
trynew trynew is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 50
hope this can help...

su
enter your root password
cd to your directory
\rm *.*


or

\rm -r your directory
  #6 (permalink)  
Old 06-25-2002
Nisha Nisha is offline
Registered User
  
 

Join Date: Jun 2002
Location: Chennai, India
Posts: 110
Hey,

Thanks for that. I changed the permissions and its working fine. I used rm -r *.* and it deleted both the directory and its contents.

Just kindly tell me this. Even when we create our own directory and files, the default permissions can only be given is it? so there is no way of deleting the files without the changing the permissions or what?

Thanks in Advance,
Nisha
  #7 (permalink)  
Old 06-25-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Two things..... this looks like it's got more complicated than it needs to be:

1) To remove all files just use '*'
The *.* that you have been using will only delete files that have the '.' character in the name.

2) If you want to remove the directory as well as its contents then you could just go up one level in the filesystem and do 'rm -rf dir_name'
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 03:09 PM.


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