ls 单词list的缩写 列表,列出来 node
一、直接ls命令会列出当前目录下全部的文件和目录vim
[root@wy ~]# lsbash
anaconda-ks.cfg install.log install.log.syslogide
二、后面加目录名spa
[root@wy ~]# ls /var排序
account cache crash cvs db empty games lib local lock log mail nis opt preserve run spool tmp ypit
三、显示目录或文件的详细信息class
[root@wy ~]# ls -lfile
total 48im
-rw-------. 1 root root 1460 Sep 9 02:39 anaconda-ks.cfg
-rw-r--r--. 1 root root 29745 Sep 9 02:39 install.log
-rw-r--r--. 1 root root 6995 Sep 9 02:37 install.log.syslog
四、查看隐藏的文件(.表示隐藏的文件)
[root@wy ~]# ls -a
. .. .bash_history .bash_logout .bash_profile .bashrc .cshrc .tcshrc .viminfo anaconda-ks.cfg install.log install.log.syslog
五、只查看当前目录自己,针对目录的,和-l 一块儿连用
[root@wy ~]# ls -ld
dr-xr-x---. 2 root root 4096 Sep 9 02:58 .
六、查看目录下按时间排序
[root@wy ~]# ls -lt /var
total 72
drwxr-xr-x. 17 root root 4096 Sep 19 18:04 run
drwxrwxr-x. 5 root lock 4096 Sep 19 17:45 lock
drwxr-xr-x. 7 root root 4096 Sep 19 17:45 log
七、查看文件的inode号(inode是用来记录文件或目录的属性信息的,它是惟一的)
[root@wy ~]# ls -i
406951 anaconda-ks.cfg 392451 install.log 392452 install.log.syslog