社区
Linux/Unix社区
帖子详情
弱问:unix下如何在ls时只显示目录?
kosuke
2003-09-04 10:55:25
rt
...全文
974
16
打赏
收藏
弱问:unix下如何在ls时只显示目录?
rt
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
16 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
woihuahua
2003-10-23
打赏
举报
回复
1、$ls -l|grep "^d"
2、$ls -F |grep \/
3、$ls -F |grep /$
4、$find . -type d exec ls -l(可以列出子目录下所有的目录名)
5、$ls -l|awk -F " " '/^d/{print $0}'
6、$ls -l|sed -n '/^d/p'
london
2003-10-21
打赏
举报
回复
果然精辟!只要利用正则表达式,可以用这些类似的办法在ls时只显示符号链接文件,可执行文件等。
yhbttfile
2003-10-21
打赏
举报
回复
其实,linux下find、grep和awk配合管道使用,可以做很多事情的。
ecfa
2003-10-20
打赏
举报
回复
find . -type d -maxdepth 1
查看详细信息
find . -type d -maxdepth 1 |ls -l
呵呵。没有fierygnu(va_list)的简单
yhbttfile
2003-10-19
打赏
举报
回复
这个简单:ls -d
raulgoal1984
2003-10-18
打赏
举报
回复
ls -d 应该就行吧 ?!
smalljason
2003-09-15
打赏
举报
回复
ls -l | grep '^d' 我用这个
踏岸寻柳
2003-09-15
打赏
举报
回复
1. ls -F |grep \/
2. ls -F |grep /$
3. ls -l |grep ^d
aria
2003-09-09
打赏
举报
回复
ls -ld *
toad197963
2003-09-09
打赏
举报
回复
ls -l |grep 'd'
fierygnu
2003-09-09
打赏
举报
回复
真的吗?呵呵。
ll就是ls -l了,怎么还要-l?
freedom_coffee
2003-09-09
打赏
举报
回复
to fierygnu(va_list) :
应该是:ll -l | grep '^d'
LITTLEMOSES
2003-09-07
打赏
举报
回复
加上help,自己去选好了
icywind
2003-09-06
打赏
举报
回复
up
scalps
2003-09-06
打赏
举报
回复
使用grep匹配:
ls -F | grep /$
fierygnu
2003-09-05
打赏
举报
回复
ls -l | grep '^d'
unix
ls
命令_Linux /
UNIX
中的
ls
命令
unix
ls
命令The
ls
command is one of the most commonly used commands in daily Linux/
UNIX
operations. The command is used in listing contents inside a directory and is one of the few commands beginners le...
unix
/linux
ls
命令的实现
Understanding
Unix
/Linux Programming(
Unix
/Linux编程实践教程) 学习模式: (1)它能做什么? (2)它是如何实现的? (3)能不能自己编写一个? (实验环境:gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) )
ls
命令学习 (1)
ls
命令能做什么
UNIX
下的
ls
命令的输出格式(ZT)
UNIX
下的
ls
命令的输出格式 作者:一笑而过 2006-05-22 12:39:59 标签: 这是
UNIX
下的
ls
命令的输出格式,Column 2 - Number of linksColumn 3 - Owner of the file. Normally the owner of the file is the user accountthat origin
Linux --
ls
只
显示目录
ls
没有直接
显示目录
的选项, 不过根据目录和文件显示的差异,可以搭配grep来实现 方法1: ll | grep "^d" 方法2:
ls
-F | grep$ "/$" # √good 同理,要只显示文件可以: ll | grep "^-"
ls
-F | grep "...
[Linux 命令]
ls
显示目录
内容列表
ls
命令 就是list的缩写,用来显示目标列表,在Linux中是使用率较高的命令。
ls
命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。
Linux/Unix社区
23,223
社区成员
74,536
社区内容
发帖
与我相关
我的任务
Linux/Unix社区
Linux/Unix社区 应用程序开发区
复制链接
扫一扫
分享
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章