Use file
. Examples:
> file --mime-type image.png
image.png: image/png
> file -b --mime-type image.png
image/png
> file -i FILE_NAME
image.png: image/png; charset=binary
More Related Contents:
- Bash script prints “Command Not Found” on empty lines
- What’s the magic of “-” (a dash) in command-line parameters?
- Is there a “goto” statement in bash?
- Expanding a bash array only gives the first element
- How can I generate new variable names on the fly in a shell script?
- How can I preserve quotes in printing a bash script’s arguments
- Bash while read loop extremely slow compared to cat, why?
- Automatically capture output of last command into a variable using Bash?
- Find multiple files and rename them in Linux
- How to find the last field using ‘cut’
- How can I loop over the output of a shell command?
- Difference between ${} and $() in Bash [duplicate]
- Why does /bin/sh behave differently to /bin/bash even if one points to the other?
- [ :Unexpected operator in shell programming [duplicate]
- How to redirect output of an already running process [duplicate]
- Command to get time in milliseconds
- How to create a hex dump of file containing only the hex characters without spaces in bash?
- How to sort strings that contain a common prefix and suffix numerically from Bash?
- How to create a CPU spike with a bash command
- Why can’t I use Unix Nohup with Bash For-loop?
- Insert multiple lines into a file after specified pattern using shell script
- Get ceiling integer from number in linux (BASH)
- How can I trim white space from a variable in awk?
- How to automatically add user account AND password with a Bash script?
- Meaning of tilde in Linux bash (not home directory)
- How do I delete all lines in a file starting from after a matching line?
- How to convert hex to ASCII characters in the Linux shell?
- How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu?
- What are the rules for valid identifiers (e.g. functions, vars, etc) in Bash?
- Bash `wait` command, waiting for more than 1 PID to finish execution