DEV Community

abbazs
abbazs

Posted on • Edited on

How to find all the empty files?

Here is how to find empty files in the current directory:

find . -maxdepth 1 -type f -empty 
Enter fullscreen mode Exit fullscreen mode

-type f --> filter only files
-empty --> filter only empty
-maxdepth --> how many levels of sub directories to search?


To find all empty files and folder

find . -empty
Enter fullscreen mode Exit fullscreen mode

To delete the empty files:

find . -maxdepth 1 -type f -empty -delete
Enter fullscreen mode Exit fullscreen mode

Use it carefully. It will delete all the empty files like __init__.py files also.

To delete files:

find . -maxdepth 1 -type f -name *.py -exec rm -rf '{}' '+'
Enter fullscreen mode Exit fullscreen mode

Use it carefully, it will delete all python files, even if they are not empty.

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay