我遇到一些关于“ls”这个命令的问题
我只想打印没有隐藏或链接的目录
但我用 man ls 查看解释,但没有找到
如果有一面旗帜表明我可以做我想做的事......
thanks
下面是我要解决的问题...
4. 显示可见出口
This is two commands: The first command prints "Visible exits: "
-> It must not advance the cursor to the next line.
The second command displays the visible exits and then a period (.).
-> To prevent the linked directories contents from also displaying, you
will need a flag.
-> Several wildcard patterns will be needed.
-> The period will be the last of these patterns.
The period means the current directory. But here it will seem, to
the user, to be a period at the end of a sentence listing visible
exits.
-> You will need to use a flag to keep the output from being
sorted (otherwise the period will not stay at the end).
-> With several patterns to search, some may have no matches. That
is OK, but we don't want to see warning messages. Redirect these.
Use ls -d */
. The */
是一个通配符,它扩展到当前目录中的所有目录(以/
). -d
tells ls
列出作为参数给出的目录名称而不是其内容。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)