ls 命令,list 的缩写,显示当前目录下的内容。
ls [选项] 目录名称
ubuntu@VM-0-14-ubuntu:~$ ls 1.sql 2.sql hello.txt test.php
ubuntu@VM-0-14-ubuntu:~$ ls -lh /var total 40K drwxr-xr-x 2 root root 4.0K Jul 19 06:25 backups drwxr-xr-x 15 root root 4.0K Apr 27 17:44 cache drwxrwxrwt 2 root root 4.0K Jul 14 06:25 crash drwxr-xr-x 54 root root 4.0K Jul 13 09:40 lib drwxrwsr-x 2 root staff 4.0K Apr 15 2020 local lrwxrwxrwx 1 root root 9 Apr 23 2020 lock -> /run/lock drwxrwxr-x 11 root syslog 4.0K Jul 20 00:00 log drwxrwsr-x 2 root mail 4.0K Apr 23 2020 mail drwxr-xr-x 2 root root 4.0K Apr 23 2020 opt lrwxrwxrwx 1 root root 4 Apr 23 2020 run -> /run drwxr-xr-x 4 root root 4.0K Apr 23 2020 spool drwxrwxrwt 5 root root 4.0K Jul 20 00:00 tmp