How do I check if the file names are numbered consecutively or missing?

Asked 2 years ago, Updated 2 years ago, 106 views

This is a general and ambiguous question, but when you download or generate a large number of files, such as 1000 or 10000 files, by operating on the terminal,

  • Are the files properly serialized (no files have strange names along the way)?
  • Do all numbers have files?

What kind of means do you use to check things like that?(Error downloading or generating results in very few errors.)

Of course, I think I can do that if I write a simple script in Python, but I think I should actually use some commands to finish the work in the shell.
There may not be a perfect method, but I would appreciate it if you could let me know if you have any recommendations or actual business knowledge.

shellscript

2022-09-30 20:16

1 Answers

When you generate it, the program should generate it, so it should be no omission.
If you download them all together using tar or zip, you'll never miss them.

So I don't check it when I download.
When analyzing after downloading, I just count the number of files in the archive.You don't have to count visually. You should be fine by wc or dead lines.


2022-09-30 20:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.