Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check file types under Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to view file types under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

There are seven file types under linux

The most common file type in Linux, including plain text files (ASCII), binary files (binary), data format files (data), and various compressed files. The first attribute is that the [-] directory file is the directory, which can be entered with the # cd command. The first attribute is [d], such as [drwxrwxrwx] block device file block device file: an interface device that stores data for system access, simply a hard disk. For example, the code of hard disk No.1 is / dev/hda1 and other files. The first attribute is the [b] character device character device file: the interface device of the serial port, such as keyboard, mouse, and so on. The first attribute is the [c] socket file, which is commonly used in network data connections. You can start a program to listen to the client's requirements, and the client can communicate through sockets. The first attribute is [s], which is most commonly seen in the / var/run directory. The pipe file FIFO is also a special file type. Its main purpose is to resolve errors caused by multiple programs accessing a file at the same time. FIFO is the abbreviation of first-in-first-out (first in first out). The first attribute is the [p] link file similar to the shortcut under Windows. The first property is [l], for example, [lrwxrwxrwx]

Three ways to view file types

1 ls

Ls-l or ll (ls-l alias)

# ll anaconda-ks.cfg? / / look at the first character-rw-. 1 root root 2460 June? 1 23:37 anaconda-ks.cfg

2 file command

[root@xiaochen ~] # file anaconda-ks.cfganaconda-ks.cfg: ASCII English text

3 stat command

Stat command to view the file ctime atime mtime

# stat anaconda-ks.cfg? File: 'anaconda-ks.cfg'? Size: 2592? Blocks: 8? IO Block: 4096? Regular fileDevice: 803h/2051d Inode: 33574996?? Links: 1Access: (0600) Uid: (?? 0 /?? root)? Gid: (?? 0 /? root) Access: 2018-09-20 05 Gid 57V 35.329041552 + 0800Modify: 2018-09-20 05 V 57 35.334041552 + 0800Change: 2018-09-20 05 V V 35.334041552 + 0800?Birth:-[root@master ~] # stat / dev/null? File:'/ dev/null'? Size: 0? Blocks: 0? IO Block: 4096? Character special fileDevice: 5h/5d Inode: 5930? Links: 1?? Device type: 1 root 3 access: (0666 Grammer)? Uid: (?? 0 /?)? Gid: (?? 0 /? root) Access: 2019-01-21 16 purl 27purl 54.255000135 + 0800Modify: 2019-01-21 16purl 27purl 54.255000135 + 0800Change: 2019-01-21 16purl 27RO 54.255000135 + 0800?Birth:-

Thank you for reading! This is the end of this article on "how to view file types under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report