LINUX系统下简单操作--查看文件、目录属性

巴扎黑
巴扎黑 原创
2017-07-17 09:30:44 1856浏览

ls:列出目录内容(默认的就是当前工作目录了)

格式:命令 [选项] [参数]

选项:

-a:列出所有文件、目录(包含隐藏文件、目录)

-l:以长格式的方式列出

-d:仅列出目录本身

-h:配合-l选项使用,以友好的方式,显示文件的大小(若不加-h,默认文件大小是以byte来显示);

实例:

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

以上就是LINUX系统下简单操作--查看文件、目录属性的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。