Find Empty Files and Directories

A useful test when performing a find operation is to locate empty files. The following example searches for all empty files and directories on the system with the -empty operator that is available on some UNIX variants, including Linux. This is only a partial output because it's so long:

# find / -empty -print /lost+found /var/adm/LST/analyse /var/spool/lpd /var/spool/news /var/spool/uucp /var/spool/mqueue /var/spool/atjobs/.SEQ /var/spool/atspool /var/spool/cron /var/spool/fax/outgoing/locks /var/spool/fax/incoming /var/spool/voice/incoming /var/spool/voice/messages /var/spool/rwho /var/spool/uucppublic /var/lib/LST/log ...

Get HP-UX 11i System Administration Handbook and Toolkit, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.