[root@zsf test]# ls –a #显示所有,包括隐藏文件
. .. dir1 dir2 dir3 file1 file2 file3
[root@zsf test]# ls -l /ll #长格式显示
total 12
drwxr-xr-x 2 root root 4096 Mar 19 14:23 dir1
drwxr-xr-x 2 root root 4096 Mar 19 14:23 dir2
[root@zsf test]# ll –h #以K,M,G来显示文件大小
total 12K
drwxr-xr-x 2 root root 4.0K Mar 19 14:23 dir1
drwxr-xr-x 2 root root 4.0K Mar 19 14:23 dir2
[root@zsf test]# touch -m file1 -d "0311" #修改更改时间
[root@zsf test]# touch -m file2 -d "0312" #修改更改时间
[root@zsf test]# ll –t #按照修改时间来排序,由近到远,默认是按照修改时间
total 0
-rw-r--r-- 1 root root 0 Mar 12 00:00 file2
-rw-r--r-- 1 root root 0 Mar 11 00:00 file1
[root@zsf test]# ll –tr #-r倒序,一般配个-t使用
total 0
-rw-r--r-- 1 root root 0 Mar 11 00:00 file1
-rw-r--r-- 1 root root 0 Mar 12 00:00 file2
[root@zsf test]# ll -d /test/ #只显示当前文件或目录的属性
drwxr-xr-x 6 root root 4096 Mar 19 14:42 /test/
[root@zsf test]# touch -a file2 -d "0313" #修改访问时间
[root@zsf test]# touch -a file1 -d "0314" #修改访问时间
[root@zsf test]# ll -tc #按照文件的访问时间来排序
total 0
-rw-r--r-- 1 root root 0 Mar 19 14:47 file1
-rw-r--r-- 1 root root 0 Mar 19 14:47 file2
[root@zsf test]# stat file2 查看状态
File: `file2'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 521236 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: -03-13 00:00:00.000000000 -0400
Modify: -03-12 00:00:00.000000000 -0400
Change: -03-19 14:47:13.681005838 -0400
[root@zsf test]# stat file1
File: `file1'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 521234 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: -03-14 00:00:00.000000000 -0400
Modify: -03-11 00:00:00.000000000 -0500
Change: -03-19 14:47:19.547994463 -0400
如果觉得《linux ls -i命令 Linux ls命令》对你有帮助,请点赞、收藏,并留下你的观点哦!