LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2005, 06:18 AM   #1
karunesh
Member
 
Registered: Jan 2002
Location: India
Distribution: CentOS/Mandriva
Posts: 126

Rep: Reputation: 15
delete file


I want a sinlge line command to delete all 0 byte files in current directory.
 
Old 11-14-2005, 06:44 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Code:
rm -i $(find * -prune -type f -size 0)
 
Old 11-14-2005, 07:33 AM   #3
prabuayyappan
Member
 
Registered: Sep 2005
Location: Coimbatore
Distribution: Prabuayyappan
Posts: 32

Rep: Reputation: 15
ll |awk '$5 ~ /^0$/ {print $9}' | xargs rm
 
Old 11-15-2005, 01:49 AM   #4
karunesh
Member
 
Registered: Jan 2002
Location: India
Distribution: CentOS/Mandriva
Posts: 126

Original Poster
Rep: Reputation: 15
Guys Thanks..it helped..
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you delete a file?? The Pentium Guy Debian 7 11-01-2004 09:30 AM
Can't delete a file elfoozo Linux - General 6 10-31-2004 06:33 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
Delete contents of the file, but not file? mikeshn Linux - General 9 05-28-2003 06:47 AM
file delete emperor13 Linux - General 1 12-06-2001 09:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:26 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
Open Source Consulting | Domain Registration