清单使用LS在bash只目录:一个检查 [英] Listing only directories using ls in bash: An examination
本文介绍了清单使用LS在bash只目录:一个检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在当前路径下此命令列出目录: LS-D * /
This command lists directories in the current path: ls -d */
到底是什么模式 * /
吗?
和我们怎么给的绝对路径在上面的命令(例如 LS -d /家庭/爱丽丝/文件
),在这条道路只列出目录?
And how can we give the absolute path in the above command (e.g. ls -d /home/alice/Documents
) for listing only directories in that path?
推荐答案
* /
是一个匹配所有在当前目录(子目录<$ C $格局C> * 将匹配所有文件的和的子目录;在 /
它限制了目录)。同样,要列出在/ home /爱丽丝/文件所有子目录,使用 LS -d /家庭/爱丽丝/文件/ * /
*/
is a pattern that matches all of the subdirectories in the current directory (*
would match all files and subdirectories; the /
restricts it to directories). Similarly, to list all subdirectories under /home/alice/Documents, use ls -d /home/alice/Documents/*/
这篇关于清单使用LS在bash只目录:一个检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文