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 command does linux use to view files and directories

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

Share

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

What command does linux use to view files and directories? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

The command to view files and directories in linux is: LS

LS English original meaning: list, command path: / bin/ls, applicable to all user rights, the main function is to display directory files in the form of a list.

Its syntax: ls option [- ald] [file or directory]

Where-a shows all files, including hidden files

-l details display

-d displays only the directory name, not the list of contents under the directory

-h humanized display (hommization)

-I view the I node of any file (similar to ID card unique information)

-t is sorted by the change time of files and directories; the most recently modified files can be judged by the first displayed file

Example:

[root@www] # ls-al ~ total 156drwxr Murray-4 root root 4096 Sep 24 00:07. Drwxr-xr-x 23 root root 4096 Sep 22 12:09.-rw- 1 root root 1474 Sep 4 18:27 anaconda-ks.cfg-rw- 1 root root 955 Sep 24 00:08. Bash _ history-rw-r--r-- 1 root root 24 Jan 6 2007. Bash _ logout-rw-r-- R root root-1 root root 191 Jan 6 2007. Bash _ profile-rw-r--r-- 1 root root 176 Jan 6 2007. Bashrcdrwx-3 root root 4096 Sep 5 10:37. Gconf-rw-r--r-- 1 root root 42304 Sep 4 18:26 install.log-rw-r--r-- 1 root root 5661 Sep 4 18:25 install.log.syslog

By using-a, you will see that. The first few files, as well as directory files (.), (.), .gconf, and so on, are hidden directories and files. Among them, the directory file name is shown in blue and the general file is shown in white.

Note that in the Linux system, hiding files is not to hide files from other users, but to tell users that these files are important system files, if not necessary, do not move! Therefore, both Linux and Windows can easily look at hidden files, but the vast majority of viruses and Trojans in Windows will turn themselves into hidden files, giving users the illusion that hidden files are intended not to be discovered by users.

Not only that, the ls command here also uses the-l option, which shows the details of the file, which shows the meaning of the seven columns:

The first column: specifies the permissions that different users have on the file, and the meaning of the specific permissions will be explained in subsequent chapters.

The second column: reference count, the reference count of a file represents the number of hard links to the file, and the reference count of a directory represents how many first-level subdirectories there are in that directory.

The third column: the owner, that is, the user to which the file belongs. The default owner is the user who created the file.

The fourth column: belongs to the group, the default belongs to the group is the file to establish the user's valid group, generally is to establish the user's group.

The fifth column: size, the default unit is bytes.

The sixth column: file modification time, file status modification time or file data modification time will change this time, note that this time is not the file creation time.

The seventh column: file name or directory name.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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