Delete zero length file
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Linux delete file with size 0 [duplicate] Ask Question. Asked 10 years, 9 months ago. Active 1 year, 11 months ago. Viewed k times. Franz Kafka Franz Kafka Add a comment. Active Oldest Votes. This will delete all the files in a directory and below that are size zero. SakiiR 2 2 silver badges 11 11 bronze badges. Paul Tomblin Paul Tomblin k 56 56 gold badges silver badges bronze badges.
Frank, you are incorrect about xargs. This commands will find all zero size files in the current directory with subdirectories and then print the full pathname for each file to the screen. The xargs will cause all the filenames to be sent as arguments to the rm -f commands. This will save processes that are forked everytime -exec rm -f is run. Again, -empty option is not a standard find option.
If the -delete option is not supported, the following command syntax can be used instead. With the above syntax, the find command will execute rm on every zero byte sized file.
If you only want to delete files in the current directory and not in sub-directories, the -maxdepth option could be used. This thread is locked. You can follow the question or vote as helpful, but you cannot reply to this thread.
I have the same question 0. Report abuse. Details required :. Cancel Submit. Jessen P.
0コメント