Linux file command

The file command is used to check a file’s type and contents in Linux environment. It is most commonly used in bash scripts and in this article we will show you the basic usage of the Linux file command.

Display info about a file

This will display a text with the file’s description, for example, “HTML document, UTF-8 Unicode text, with very long lines” or “Zip archive data, at least v2.0 to extract”

file myFile.txt # => myFile.txt: ASCII text

Viewing mime type

file -i database.sql # => database.sq: text/html; charset=utf-8

You can also try to look into an archive

file -z myArchive.tar.gz
  • 0 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

Linux export command

When you’re managing your shell’s variables and you wish to save them to your environment you can...

Linux su command

The su command is most commonly used to switch to another user. You will then be able to run...

Linux wc command

If you’re interested in finding the word count or lines of a file in your Linux environment you...

Linux ln command

When you want to create “shortcuts” to different files in a Linux system you have to create a...

Powered by WHMCompleteSolution