this post was submitted on 20 Dec 2025
27 points (100.0% liked)
Linux
11254 readers
259 users here now
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Your syntax is fine, but not all commands/programs accept input from the pipe, or more accurately from stdin. Looking at the man page for file (https://www.man7.org/linux/man-pages/man1/file.1.html) I can't see a stdin option, so you have to pass each of the files from your
headoutput as arguments to file.Thanks! Yeah, I just came to the realization that this was more about my lack of understanding of the file command than anything else.
I learned this the hardway with ffmpeg... In my defense... Their documentation IS huge !!!
Kinda interested if
2>&1would also work in this case?2>&1pipes stderr to stdout, which would not affect a binary like file which doesn't parse stdin. You would need something likexargs filewhich would convert the stdout to command line arguments.Thanks for the clarification :)) still new the all the bash syntax and always interested to hear what more skilled people have to say !