简体   繁体   English

如何找到我使用 curl 命令下载的空文件?

[英]How can find the empty files that I downloaded using the curl command?

I executed curl command to retrieve, from the following webpage "http://files.rcsb.org/view/IDENTIFIER.pdb" the PDB files that have an identifier starting with 1W followed by any digit and ending with any upper case letter and save each into a separate file.我执行了 curl 命令以从以下网页“http://files.rcsb.org/view/IDENTIFIER.pdb”检索 PDB 文件,这些文件的标识符以 1W 开头,后跟任何数字并以任何大写字母和结尾将每个保存到单独的文件中。 But some of these files don't exist.但是其中一些文件不存在。 My question is how to delete them.我的问题是如何删除它们。

I first run this command to download the files: curl http://files.rcsb.org/view/1W[0-9][AZ].pdb -o file_#1#2.txt我首先运行这个命令来下载文件: curl http://files.rcsb.org/view/1W[0-9][AZ].pdb -o file_#1#2.txt

I got 260 files我有 260 个文件

enter image description here在此处输入图像描述

What command should I run to remove empty files?我应该运行什么命令来删除空文件? Thank you!谢谢!

As far as I know, the find command has a -delete parameter you can use.据我所知, find命令有一个可以使用的-delete参数。 It also has has a -size parameter for filtering on size.它还有一个-size参数用于过滤大小。 The combination of both leads to this:两者结合导致:

find ./ -type f -size 0 -delete

The URL, I refer to, gives some more background information and examples concerning the command.我参考的 URL 提供了有关该命令的更多背景信息和示例。

Good luck祝你好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM