#scp命令 1.命令简介 Linux ls命令用于显示指定工作目录下之内容(列出目前工作目录所含之文件及子目录)。 2.命令格式 ls [ 选项 ] "参数..." 3.常用选项 -a 显示所有文件及目录 (ls内定将文件名或目录名称开头为"."的视为隐藏档,不会列出) -l 除文件名称外,亦将文件型态、权限、拥有者、文件大小等资讯详细列出 -r 将文件以相反次序显示(原定依英文字母次序) -t 将文件依建立时间之先后次序列出 -A 同 -a ,但不列出 "." (目前目录) 及 ".." (父目录) -F 在列出的文件名称后加一符号;例如可执行档则加 "*", 目录则加 "/" -R 若目录下有文件,则以下之文件亦皆依序列出 4.支持案例 # ls -lh #查看文件属性统计占用磁盘大小 total 6.3G drwxr-xr-x 8 root root 4.0K Aug 19 2019 bak -rw-r--r-- 1 root root 24K May 4 15:33 exclude.txt drwxr-xr-x 21 root root 4.0K Jul 27 13:23 note -rw-r--r-- 1 root root 11M May 21 23:41 python-3.8.3-docs-html.zip drwxr-xr-x 3 root root 4.0K Jul 7 17:54 scripts drwxr-xr-x 3 root root 4.0K Mar 24 12:34 software drwxr-xr-x 2 root root 4.0K Jun 29 18:48 test -rw-r--r-- 1 root root 6.3G Apr 13 22:14 tmose.tar.gz # ls -lht #查看文件属性统计占用磁盘大小并按时间倒序排列 total 6.3G drwxr-xr-x 21 root root 4.0K Jul 27 13:23 note drwxr-xr-x 3 root root 4.0K Jul 7 17:54 scripts drwxr-xr-x 2 root root 4.0K Jun 29 18:48 test -rw-r--r-- 1 root root 11M May 21 23:41 python-3.8.3-docs-html.zip -rw-r--r-- 1 root root 24K May 4 15:33 exclude.txt -rw-r--r-- 1 root root 6.3G Apr 13 22:14 tmose.tar.gz drwxr-xr-x 3 root root 4.0K Mar 24 12:34 software drwxr-xr-x 8 root root 4.0K Aug 19 2019 bak # ls -lhtr #查看文件属性统计占用磁盘大小并按时间倒序排列 total 6.3G drwxr-xr-x 8 root root 4.0K Aug 19 2019 bak drwxr-xr-x 3 root root 4.0K Mar 24 12:34 software -rw-r--r-- 1 root root 6.3G Apr 13 22:14 tmose.tar.gz -rw-r--r-- 1 root root 24K May 4 15:33 exclude.txt -rw-r--r-- 1 root root 11M May 21 23:41 python-3.8.3-docs-html.zip drwxr-xr-x 2 root root 4.0K Jun 29 18:48 test drwxr-xr-x 3 root root 4.0K Jul 7 17:54 scripts drwxr-xr-x 21 root root 4.0K Jul 27 13:23 note # ls -a . bak .bash_logout .bashrc .config exclude.txt note .pki python-3.8.3-docs-html.zip software .tcshrc tmose.tar.gz .. .bash_history .bash_profile .cache .cshrc .lesshst .pip .pydistutils.cfg scripts .ssh test .viminfo # ls -al total 6535572 dr-xr-x---. 12 root root 4096 Jul 27 13:23 . dr-xr-xr-x. 19 root root 4096 Jul 27 13:33 .. drwxr-xr-x 8 root root 4096 Aug 19 2019 bak -rw------- 1 root root 28768 Jul 27 13:33 .bash_history -rw-r--r--. 1 root root 18 Dec 29 2013 .bash_logout -rw-r--r--. 1 root root 176 Dec 29 2013 .bash_profile -rw-r--r--. 1 root root 176 Dec 29 2013 .bashrc drwxr-xr-x 3 root root 4096 Mar 7 2019 .cache drwxr-xr-x 3 root root 4096 Mar 7 2019 .config -rw-r--r--. 1 root root 100 Dec 29 2013 .cshrc -rw-r--r-- 1 root root 24369 May 4 15:33 exclude.txt -rw------- 1 root root 42 Nov 5 2019 .lesshst drwxr-xr-x 21 root root 4096 Jul 27 13:23 note drwxr-xr-x 2 root root 4096 Mar 20 11:01 .pip drwxr----- 3 root root 4096 Apr 13 22:58 .pki -rw-r--r-- 1 root root 73 Mar 20 11:01 .pydistutils.cfg -rw-r--r-- 1 root root 10794009 May 21 23:41 python-3.8.3-docs-html.zip drwxr-xr-x 3 root root 4096 Jul 7 17:54 scripts drwxr-xr-x 3 root root 4096 Mar 24 12:34 software drwx------ 2 root root 4096 Mar 20 13:17 .ssh -rw-r--r--. 1 root root 129 Dec 29 2013 .tcshrc drwxr-xr-x 2 root root 4096 Jun 29 18:48 test -rw-r--r-- 1 root root 6681475371 Apr 13 22:14 tmose.tar.gz -rw------- 1 root root 6569 Jul 27 13:23 .viminfo # ls -l --full-time #查看文件完整时间 total 6535472 drwxr-xr-x 8 root root 4096 2019-08-19 01:50:13.000000000 +0800 bak -rw-r--r-- 1 root root 24369 2020-05-04 15:33:53.695421817 +0800 exclude.txt drwxr-xr-x 21 root root 4096 2020-07-27 13:23:19.469482962 +0800 note -rw-r--r-- 1 root root 10794009 2020-05-21 23:41:51.626735244 +0800 python-3.8.3-docs-html.zip drwxr-xr-x 3 root root 4096 2020-07-07 17:54:17.907461742 +0800 scripts drwxr-xr-x 3 root root 4096 2020-03-24 12:34:13.274628346 +0800 software drwxr-xr-x 2 root root 4096 2020-06-29 18:48:45.920634699 +0800 test -rw-r--r-- 1 root root 6681475371 2020-04-13 22:14:25.888252588 +0800 tmose.tar.gz # ll -t --full-time #查看完整时间并按时间倒序排列 total 6535472 drwxr-xr-x 21 root root 4096 2020-07-27 13:23:19.469482962 +0800 note drwxr-xr-x 3 root root 4096 2020-07-07 17:54:17.907461742 +0800 scripts drwxr-xr-x 2 root root 4096 2020-06-29 18:48:45.920634699 +0800 test -rw-r--r-- 1 root root 10794009 2020-05-21 23:41:51.626735244 +0800 python-3.8.3-docs-html.zip -rw-r--r-- 1 root root 24369 2020-05-04 15:33:53.695421817 +0800 exclude.txt -rw-r--r-- 1 root root 6681475371 2020-04-13 22:14:25.888252588 +0800 tmose.tar.gz drwxr-xr-x 3 root root 4096 2020-03-24 12:34:13.274628346 +0800 software drwxr-xr-x 8 root root 4096 2019-08-19 01:50:13.000000000 +0800 bak