Score:0

How do I make sure my file is a video file?

bi flag

How can I copy video files from a directory and rest assured that the file I copied was a video file and not something else with a video extension like ".mp4"?

Artur Meinild avatar
vn flag
I would assume there is some metadata in the file that you can check, but I'm not overly familiar with the `mp4` file format. But think metadata, not extension.
Score:4
us flag

If you run the file command on the mp4 file it should identify it as an mp4 file if it really is one...

If I download an example mp4 file and run file on it I get this...

$ file file_example_MP4_480_1_5MG.mp4
file_example_MP4_480_1_5MG.mp4: ISO Media, MP4 v2 [ISO 14496-14]

If the file isn't an mp4 file, even if it has an mp4 extension then file will identify it as something else.

Artur Meinild avatar
vn flag
Good and simple solution!
nobody avatar
gh flag
maybe helpful for use in script https://unix.stackexchange.com/questions/179898/find-file-by-magic-pattern-maching
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.