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

Example Analysis of ls Command and File attributes in linux

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

Share

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

This article mainly shows you the "sample analysis of ls commands and file attributes in linux", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and study the "sample analysis of ls commands and file attributes in linux".

I. File attributes

1. File type

-: ordinary document (f)

D: catalog file

B: block device file (block)

C: character device file (character)

L: symbolic link file (symbolic link file)

P: command pipe file (pipe)

S: socket file (socket)

2. Permissions: one group for every three digits, and three permissions for each group of rwx

3. The number of hard connections to files

4. Document owner (owner)

5. File group (group)

6. File size (size) in bytes

7. Time stamp (timestamp): the time when it was last modified

Access time: access

Modification time: modify, change the file content

Change time: change,metadata: metadata, change file attributes (file name, etc.)

8. File name

II. Ls command

Common commands:

1. Ls: list all non-hidden files

2. Ls-al: displays the details of all files

3. Ls-l: shows the details of all non-hidden files

4. Ls-l: displays the details of files whose filenames match the regular expression.

5. Ls-lh: display size in K, G, etc.

6. Ls-lhS: displays files in descending order by file size

7. Ls-R: display child files

8. Ls-lR: recursively displays the files in the directory

9. Ls-lt: displayed in chronological order

10. Ls-lrt: display files in ascending order of file modification time

11. Ls-ldh: displays the properties of the current directory

12. Ls-I: display inode

Function description: list the contents of the directory.

Grammar: ls [- 1aAbBcCdDfFgGhHiklLmnNopqQrRsStuUvxX] [- I] [- T] [- w] [--block-size=] [--color=] [--format=] [--full-time] [--help] [--indicator-style=] [--quoting-style=] [--show-control-chars] [--sort=] [--time=] [--version] [file or directory.]

Supplementary note: execute the ls directive to list the contents of the directory, including the names of files and subdirectories.

Parameters:

1.-1 displays only one file or directory name per column. /

2. All files and directories under-an or-- all.

3.-An or-- almost-all displays all files and directories, but does not show the current and upper-level directories.

4.-b or-- escape displays detached characters.

5.-B or-- ignore-backups ignores backup files and directories.

6.-c sort by change time, displaying files and directories.

7.-C displays file and directory names in a straight line from top to bottom, from left to right.

8,-d or-- directory displays the directory name instead of its contents.

9,-D, or-- dired uses Emacs mode to generate lists of files and directories.

10.-f the effect of this parameter is the same as specifying the "aU" parameter at the same time and turning off the effect of the "lst" parameter.

11,-F or-- classify add "*", "/", "=", "@", "|" to the executable, directory, Socket, symbolic link, and pipe name respectively.

12.-g times parameters will be ignored and will not be processed.

13,-G or-- no-group do not display the group name.

14,-h or-- human-readable use "K", "M", "G" to display the size of files and directories.

15,-H, or-- si this parameter is similar to specifying the "- h" parameter, but is calculated in 1000Bytes rather than 1024Bytes.

16,-I, or-- inode displays the inode number of files and directories.

17,-I, or-- ignore= do not display file or directory names that match the template style.

18,-k, or-- kilobytes this parameter has the same effect as specifying the "block-size=1024" parameter.

19.-l uses a list of detailed formats.

20,-L or-- dereference if you encounter a file or directory with a symbolic connection, directly list the original file or directory that the connection points to.

21.-m uses the "," sign to separate the names of each file and directory.

22,-n or-- numeric-uid-gid replaces its name with a user identification code and a group identification code.

23,-N, or-- literal lists file and directory names directly, including control characters.

24.-o the effect of this parameter is similar to that of specifying the "- l" parameter, but the group name or identification code is not listed.

25,-p, or-- file-type this parameter is similar to specifying the "- F" parameter, but does not add a "*" to the name of the execution file.

26,-Q or-- hide-control-chars use "?" Instead of the control character, the file and directory names are listed.

27,-Q or-- quote-name marks the file and directory names with a "" sign.

28,-r, or-- reverse reverse sort.

29,-R or-- recursive recursive processing, processing all files and subdirectories under the specified directory together.

30,-s, or-- size displays the size of files and directories in chunks.

31.-S sorts by the size of files and directories.

32.-t is sorted by the change time of files and directories.

33,-T, or-- tabsize= sets the number of white space characters corresponding to tabbed characters.

34,-u sort by last access time, displaying files and directories.

35,-U does not sort when listing file and directory names.

36. The list of names of-v files and directories is sorted by version.

37,-w, or-- width= sets the maximum number of characters per column.

38,-x displays file and directory names in horizontal columns from left to right and from top to bottom.

39,-X is sorted by the last extension of the file and directory.

40.-- block-size= specifies the size of the block in which the file is stored.

41.-the list format of color= cultivation files and directories.

42.-- full-time lists the complete date and time.

43.-help online help.

44.-- indicator-style= adds annotations after names such as files and directories, making it easy to identify the type to which the name belongs.

45.-- quoting-syte= marks file and directory names in the specified quotation mark style.

46.-- show-control-chars uses control characters when listing files and directories.

47.-how sort= configuration files and directory lists are sorted.

48.-- time= replaces the change time with the specified timestamp.

49.-- version displays version information.

The above is all the contents of the article "sample Analysis of ls commands and File attributes in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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