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

The method of viewing File format in linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces the method of linux to view the file format, which has a certain reference value, friends who need can refer to it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Common Linux file types are: ordinary files, directories, character device files, block device files, symbolic link files and so on.

Linux's way to view the file format:

1. 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.cfg anaconda-ks.cfg: ASCII English text

3. Stat command

# stat install.log / / View the detailed attributes of the file (including the file time attribute) File: "install.log" Size: 34793 Blocks: 80 IO Block: 4096 General file Device: 802h/2050d Inode: 65282 Links: 1Access: (0644mow Uid: (0 / root) Gid: ( 0 / root) Access: 2017-06-05 16purl 53 purl 20.000000000 + 0800Modify: 2017-04-22 1349purl 46.0000000000000 + 0800Change: 2017-04-2213lv 49purl 52.000000000000 + 0800

Linux file type:

1. Common file types

One of the most common file types in Linux, including plain text files (ASCII), binary files (binary), data format files (data), and various compressed files. The first attribute is [-].

2. Directory file

This is the directory, which can be accessed with the # cd command. The first attribute is [d], for example, [drwxrwxrwx].

3. Character device or 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 [b].

Character device file: the interface device of the serial port, such as keyboard, mouse, etc. The first attribute is [c].

4. Socket file

Such files are usually used for 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.

5. Pipeline file

FIFO is also a special file type, and its main purpose is to solve 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 [p].

6. Link the file

Similar to the shortcut below Windows. The first attribute is [l], for example, [lrwxrwxrwx].

Thank you for reading this article carefully. I hope it will be helpful for everyone to share the content of linux to view the file format. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

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

Servers

Wechat

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

12
Report