Answers for "get type of file linux"

2

python get file extension from path

import os.path
extension = os.path.splitext(filename)[1]
Posted by: Guest on May-08-2020
1

find file type linux script

#! /bin/sh
if [ -f "$1" ] && [ "`file -b --mime-type \"$1\"`" = "image/jpeg" ]; then
    echo "Good type for the file (JPEG)"
fi
Posted by: Guest on January-20-2021
1

how to get file type in linux

file <filename>
Posted by: Guest on November-07-2020

Python Answers by Framework

Browse Popular Code Answers by Language