I am going to use "file" to check file type of a buch of files. I need to get it to print output file mime type without charset part.
My code:
file dog.jpeg -i
Output:
dog.jpeg: image/jpeg; charset=binary
What I want:
dog.jpeg: image/jpeg
I am going to use "file" to check file type of a buch of files. I need to get it to print output file mime type without charset part.
My code:
file dog.jpeg -i
Output:
dog.jpeg: image/jpeg; charset=binary
What I want:
dog.jpeg: image/jpeg
From the
man
page:So by way of example:
So you want
file --mime-type dog.jpeg
.This may not be a clean way of doing but you can utilize the
cut
cmd.cut del fields