列表文件不匹配的模式? [英] List files not matching a pattern?

查看:142
本文介绍了列表文件不匹配的模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是怎么一会列出匹配在bash模式中的所有文件:

  LS的* .jar

如何列出一个模式的补充?即所有文件不匹配的* .jar?


解决方案

  LS | grep的-v'\\ $的.jar

例如

Here's how one might list all files matching a pattern in bash:

ls *.jar

How to list the complement of a pattern? i.e. all files not matching *.jar?

解决方案

ls | grep -v '\.jar$'

for instance.

这篇关于列表文件不匹配的模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆