How to use the file command under Linux

Source: Internet
Author: User

Tag: The file command uses

1    . Windows distinguish different files with different extensions, for example: . exe. PNG wait

2. There are no explicit requirements for extensions under Linux Sometimes you will encounter a variety of pits, when we do not know is a compressed file, with some commands to view the time, there will be various garbled

[email protected] ~]# cat text |head Y Noble 8о+ub.°@¤q:%durr) xs weak ±o§ 萞L 泏d2§ Infiltration 2c

3. use file to view files type

[[Email protected] ~]# file text

Text: gzip compressed Data, from Unix, last modified:wed 23 23:10:14 2017

[Email protected] ~]#

4. It can be seen that this is a compressed file, can be used,tar-tf View

[Email protected] ~]# Tar-tftext

Etc/services

[Email protected] ~]#

5. for a file with no extension, you can view the file type

[Email protected] ~]# file/bin/ls/etc/hosts ser.tar.gz

/bin/ls:elf 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for gnu/li Nux 2.6.18, stripped

/etc/hosts: asciitext

ser.tar.gz: gzipcompressed data, from Unix, last modified:wed 23 23:10:14 2017

[Email protected] ~]#


This article is from the "13091780" blog, please be sure to keep this source http://13101780.blog.51cto.com/13091780/1960896

How to use the file command under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.