Linux Shell Scripting: Mime type without filename

for f in *
do 
  mime=`file -i $f`
  echo $mime
done

Open in new window

How can I get it to return something like:
text/plain; charset=us-ascii
insteead of:
file.txt: text/plain; charset=us-ascii
LVL 16
hankknightAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
simon3270Connect With a Mentor Commented:
Add "-b" as a parameter
    file -b -i $f
0
 
simon3270Commented:
I've just answered this in another of your questions - do you want to close this as a duplicate question?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.