Simple operation under LINUX system--View file and directory attributes

巴扎黑
Release: 2017-07-17 09:30:44
Original
2390 people have browsed it

ls: List directory contents (the default is the current working directory)

Format: command [options] [parameters]

Options:

-a: List all files and directories (including hidden files and directories)

-l: List in long format

-d: List only the directory itself

-h: Used with the -l option to display the file size in a friendly way (if -h is not added, the default file size is displayed in bytes);

Example:

[root@uni test]# ls
dir file file1
[root@uni test]# ls -l
Total usage 10248
drwxr-xr-x 2 root root 4096 July 16 15:30 dir
-rw-r--r-- 1 root root 7 July 16 15:30 file
-rw-r-- r-- 1 root root 10485760 July 16 15:32 file1
[root@uni test]# ls -lh
Total usage 11M
drwxr-xr-x 2 root root 4.0K July 16 15:30 dir
-rw-r--r-- 1 root root 7 July 16 15:30 file
-rw-r--r-- 1 root root 10M July 16 15:32 file1
[root@uni test]# ls -alh
Total usage 11M
drwxr-xr-x 3 root root 4.0K July 16 15:32 .
drwxr-xr-x. 3 root root 4.0K July 16 14:04 ..
drwxr-xr-x 2 root root 4.0K July 16 15:30 dir
-rw-r- -r-- 1 root root 7 July 16 15:30 file
-rw-r--r-- 1 root root 10M July 16 15:32 file1
[root@uni test] #ls -ldh
drwxr-xr-x 3 root root 4.0K July 16 15:32 .

The above is the detailed content of Simple operation under LINUX system--View file and directory attributes. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template