LoginSignup
0
0

More than 5 years have passed since last update.

fileコマンドを使ってみた

Posted at

拡張子がjpgになっているけどjpg用の処理ができないつって
実は拡張子がjpgなだけどpng画像だったなんてことがありました。

慌てず騒がずまずは事実確認。
そう、ファイルの情報を見るときはfileコマンドを利用するのです。

拡張子をjpgに変えたpng画像の例
$ file /path/to/fake/img/01.jpg

ちゃんとPNG image dataとして判定されている

/path/to/fake/img/01.jpg: PNG image data, 960 x 330, 8-bit colormap, non-interlaced

参考
http://webkaru.net/linux/file-command/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0