How to find if a file is zero byte or not?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to find if a file is zero byte or not?
# 1  
Old 08-09-2007
How to find if a file is zero byte or not?

hi,

How to check if a file or files are of zero bytes and if yes, then to print their names?


Ashu
# 2  
Old 08-09-2007
You can use this!

find . -size 0

regards joerg
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Logrotate 0 byte file

Hello, For various reasons I decided to rebuild my log server on a new microSD. To simplify matters I restored a backed up copy of the appropriate config files and uploaded them to the new log server once syslog-ng was setup. The issue I am running into now is when logrotate compresses the log... (3 Replies)
Discussion started by: MyUserName7000
3 Replies

2. UNIX for Dummies Questions & Answers

Need a shell script to find 0 byte files in 5 servers

Hi..... Thanks for this wonderful forum.... My request: I have toatally 5 unix servers in which many applications are working I need to set a trap to identify 0 byte files if any are created proactively. For example: find /apps/fresco/ -mtime 1 -size 0c –print >>... (3 Replies)
Discussion started by: ChandruBala73
3 Replies

3. Shell Programming and Scripting

Find zero byte file but don't need path

Just i want to ask How to search and display name of zero byte file I have used find command but it is showing complete file path Thanks find . -size 0 giving me zero byte file with location 1)/home/user/a (4 Replies)
Discussion started by: vivek1489
4 Replies

4. Shell Programming and Scripting

Checking the file for non-zero byte

Hi, An 'If' clause has to be executed if file1.txt has any contents in it. Suggest us... (2 Replies)
Discussion started by: lavnayas
2 Replies

5. Shell Programming and Scripting

delete zero byte file

Hello I have a requirement where i need to find the zero byte size file in the directory and need to delete that zero byte file. Thanks (2 Replies)
Discussion started by: dsdev_123
2 Replies

6. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

7. UNIX for Dummies Questions & Answers

ftp 0 byte file

I have some clients uploading 0byte files to my ftp server unfortunately they dial in to an isp first so I'm not having any luck figuring out where they are coming from. I'm looking for a way to have the ftp server reject 0 byte files I checked man on vsftpd and did not see anything is there... (1 Reply)
Discussion started by: jjmill1979
1 Replies

8. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

9. Shell Programming and Scripting

0 byte file with no name????

Please help me in removing the 2nd file : -rw-rw-rw- 1 fup03a fup03a 9216 Aug 16 00:45 med_delay_log -rw-rw-rw- 1 fup03a fup03a 0 Aug 16 18:04 (5 Replies)
Discussion started by: miltonkeynesguy
5 Replies

10. Filesystems, Disks and Memory

shell script to find zero byte files

I have a directory MYDIR In which i have several directories 1,2,3,4.... Now, In each of these directories i have several files a.dat, b.dat, c.dat, d.dat..... MYDIR ----1 ---------a.dat ---------b.dat ---------c.dat ---------d.dat ----2 ---------a.dat ---------b.dat ---------c.dat... (2 Replies)
Discussion started by: ramky79
2 Replies
Login or Register to Ask a Question