We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

How can I check a file's mimetype from fingerterm? [answered]

asked 2015-02-06 23:39:40 +0200

rdmo gravatar image

updated 2015-03-28 09:27:21 +0200

I haven't been able to find how to find out a file's MIME using its filename as an argument with the command. xdg-mime doesn't seem intended for that. Am I missing using some obvious executable?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by VDVsx
close date 2015-02-09 16:54:38.309635

1 Answer

Sort by » oldest newest most voted
5

answered 2015-02-07 00:20:18 +0200

smoku gravatar image
xdg-mime query filetype filename.foo

i.e.

$ xdg-mime query filetype smoku.png            
image/png
edit flag offensive delete publish link more

Comments

@smoku: Thanks!

xdg-mime query filetype \

application/octet-stream; charset=binary

Hmm..

rdmo ( 2015-02-07 00:53:10 +0200 )edit

It basically means: I have no flocking idea what this file is.

smoku ( 2015-02-07 01:18:08 +0200 )edit
3

Also, file-command gives you some useful info abt the file and it's type, try:

file img.png
foss4ever ( 2015-02-07 07:09:14 +0200 )edit

[nemo@Jolla ~]$ file \ #

: data

rdmo ( 2015-02-07 08:49:50 +0200 )edit

@rdmo If I type

file \ #

in my Jolla terminal, I get the following error msg:

#: ERROR: cannot open ' #' (No such file or directory)

So, there is something wrong how u type the commands in the terminal (cause as given they don't output such texts as you report here).

foss4ever ( 2015-02-07 11:28:29 +0200 )edit

Question tools

Follow
1 follower

Stats

Asked: 2015-02-06 23:39:40 +0200

Seen: 239 times

Last updated: Mar 26 '15