
- Forum
- Operating Systems
- Linux
- List of Files
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. ...
-
05-18-2007, 04:10 PM #1
- Join Date
- Apr 2006
- Answers
- 124
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?
-
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.

Reply With Quote





