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

What are the ls commands and file attributes in Redhat

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article to share with you is about Redhat ls command and file attributes are what, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some gains, not much to say, follow Xiaobian to see it.

I. File attributes

file type

- : general documentation (f)

d: Catalog file

b: block device file (block)

c: Character device file (character)

l: symbolic link file

p: Command pipe file (pipe)

s: socket file

Permission: Each group consists of three characters, and each group has rwx three permissions.

Number of file hardlinks

File owner

File belongs to group

File size, in bytes

timestamp: the last time it was modified

Time of visit: access

Modify time: modify, change the content of the file

change time metadata change file attributes (file name etc. is modified)

file name

II. The LS Command

Common commands:

ls: List all non-hidden files

ls -al: Displays details of all files

ls -l: Show details of all non-hidden files

ls -l: Displays details of files whose filenames match regular expressions.

ls -lh: Display size in K, G, etc.

ls -lhS: displays files in descending order of file size

ls -R: Show child files

ls -lR: Recursively display files in directories

ls -lt: display in chronological order

ls -lrt: displays files in ascending order of file modification time

ls -ldh: Displays properties of the current directory

ls -i: Display inode

Function Description: List the contents of the directory.

Language: ls [-1aAbBcCdDfFgGhHiklLmnNopqrRsStuUvxX][-I ][-T ][-W ][--block-size=][--color=][--format=][--full-time][--help][--indicator-style=][--quoting-style=][--show-control-chars][--sort=][--time=][--version][Document or catalogue...]

Additional Note: Executing the ls command lists the contents of a directory, including the names of files and subdirectories.

Parameters:

-1 Only one file or directory name is displayed per column./

-a or--all.

-A or--almost-all Displays all files and directories, but does not display the current directory and upper directories.

-b or--escape displays the escape character.

-B or--ignore-backups Ignore backup files and directories.

-c to change the chronological sort, showing files and directories.

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

-d or--directory Displays the directory name rather than its contents.

-D or--direct generates file and directory lists using Emacs 'schema.

-f This parameter has the same effect as specifying the "aU" parameter at the same time, and turns off the effect of the "lst" parameter.

-F or--classify After the execution file, directory, Socket, symbolic connection, pipe name, add "*","/","=","@","respectively|"No.

-g arguments are ignored.

-G or--no-group does not display group names.

-h or--human-readable Use "K","M","G" to display file and directory sizes.

-H or--si This parameter has the same effect as specifying the "-h" parameter, but is calculated in 1000Bytes instead of 1024Bytes.

-i or--inode Displays the inode number of files and directories.

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

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

-l Use detailed format lists.

-L or--dereference If you encounter a file or directory that is a symbolic link, directly list the original file or directory to which the link points.

-m Separates the names of each file and directory with a "," sign.

-n or--numeric-uid-gid Replace its name with a user ID and group ID.

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

-o This parameter has the same effect as specifying the "-l" parameter, but does not list the group name or identifier.

-p or--file-type This parameter has the same effect as specifying the "-F" parameter, but without adding an "*" to the execution file name.

-q or--hide-control-chars with "? The "sign replaces the control character and lists file and directory names.

-Q or--quote-name Mark file and directory names with a "."

-r or--reverse reverse sort.

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

-s or--size Displays the size of files and directories in blocks.

-S Sorts by file and directory size.

-t Sort by time of file and directory changes.

-T or--tabsize= Sets the number of white space characters corresponding to tab characters.

-u Displays files and directories sorted by last access time.

-U Lists file and directory names without sorting.

-v List of names of files and directories sorted by version.

-w or--width= Sets the maximum number of characters per column.

-x Displays file and directory names in rows from left to right and top to bottom.

-X Sorts files and directories with the last extension.

--block-size= Specifies the block size of the file.

--color= list format for cultivating files and directories.

--full-time Lists the full date and time.

--help Online help.

--indicator-style= label names such as files and directories to make it easy to identify the type to which the name belongs.

--quoting-syte= Enclose file and directory names in quotation marks.

--show-control-charsUse control characters when listing files and directories.

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

--time= Replace the change time with the specified timestamp.

--version Displays version information.

The above is what the ls command and file attributes in Redhat are. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please 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