Exforsys

Online Training

List of Files

This is a discussion on List of Files within the Linux forums, part of the Operating Systems category; I am working with UNIX operating system and right now I am in the process of removing all unwanted files. ...


Go Back   Exforsys > Operating Systems > Linux

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-18-2007, 04:10 PM
Senior Member
 
Join Date: Apr 2006
Posts: 145
Rahulbatra is on a distinguished road
List of Files

I am working with UNIX operating system and right now I am in the process of removing all unwanted files. I want to get all zero bytes files stored in all directories listed so that I can delete all these at a shot. How can I get the list of all zero bytes files stored in all directories?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-19-2007, 04:27 PM
Senior Member
 
Join Date: Apr 2006
Posts: 144
caradoc is on a distinguished road
For this you must write a shell script. In that first you must get the list of directories using ls command and pipe the output to find command given below as:
find /path/to/directory -size 0 -type f -exec rm -f {} \;

Use the above in a loop until all directories are executed with the above command. This will remove all your zero bytes files stored in all directories in your UNIX operating system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

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


Similar Threads

Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
comp.cad.autocad AutoLISP FAQ (part 2/2) - samples, code Reini Urban Tech FAQ 0 06-01-2004 06:30 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 05-15-2004 07:00 AM
Apple II Csa2 FAQs: Uploading & Downloading, Part 21/25 rubywand@swbell.net Tech FAQ 0 05-04-2004 10:01 AM
comp.cad.autocad AutoLISP FAQ (part 2/2) - samples, code Reini Urban Tech FAQ 0 05-01-2004 06:30 AM


All times are GMT -4. The time now is 03:44 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.