1.命令格式:
Ls 显示指定工作目录下的目录内容
语法:ls [-alrtAFR] [name...]
2.命令参数:
3.命令功能:
显示列出目前工作目录所含之文件及子目录
4.命令范例:
列出根目录(\)下的所有目录:
[[email protected] ~]# ls /
a bin c dev etc? lib media oldboy opt? root sbin sys usr
b boot data etc home lib64 mnt opt proc run srv tmp var
列出目前工作目录下所有名称是 s 开头的文件,越新的排越后面 :
[[email protected] bin]# ls -ltr s*
-rwxr-xr-x. 1 root root 218 Sep 10 2010 spd-conf
-rwxr-xr-x. 1 root root 11824 Dec 28 2013 sendiso
-rwxr-xr-x. 1 root root 21072 Dec 29 2013 setserial
-rwxr-xr-x. 1 root root 84 Dec 29 2013 system-config-date
-rwxr-xr-x. 1 root root
-rwxr-xr-x. 1 root root 41568 Jan 25 2014 sha384sum
-rwxr-xr-x. 1 root root 41576 Jan 25 2014 sha256sum
-rwxr-xr-x. 1 root root 41576 Jan 25 2014 sha224sum
-rwxr-xr-x. 1 root root 37408 Jan 25 2014 sha1sum
列出目前工作目录下所有文件及目录;目录于名称后加 "/", 可执行档于名称后加 "*" :
ls -lF /*
[[email protected] bin]# ls -AF
[* gst-inspect* ptx*
a2p* gst-inspect-0.10* pulseaudio*
abrt-action-analyze-backtrace* gst-inspect-1.0* purple-client-example*
原文地址:https://www.cnblogs.com/mayi2019/p/10205459.html