[Bash] Find Files and Folders with `find` in Bash
2024-08-30 17:28:22
find
is a powerful tool that can not only find files but it can run a command on each matching file too. In this lesson, we’ll learn how to find all the images that match a pattern and run an image optimization tool on them.
FInd files:
find images/ -name "*.png"
find images/ -iname "*.png" # case insensetive
Find folder:
find . -type d -name "images" # find folder named images
Doing deleting: '-delete'
find dist/ -name "*.built.js" -delete
Run command after finding the matching: '-exec'
find images/ -name "*.png" -exec pngquant {} \;
最新文章
- 集群下session共享问题的解决方案.
- public protect private. 草稿。
- Understanding the Internal Message Buffers of Storm
- java那些小事---用偶数做判断,不要用基数做判断
- jquery 时间运算、格式化的方法扩张
- python 发送邮件实例
- C安全编码--预处理
- CSS3 弹性盒布局模型(转)
- Redis学习手册(虚拟内存)
- SSH-KeyGen 的用法 【转载】
- Python新手学习基础之运算符——成员运算与身份运算
- css 实现评分效果
- ASP.NET MVC HttpPostedFileBase文件上传
- WebLogic重启
- 【20190407】JavaScript-indexOf方法解析
- CentOS 6.5 搭建 .NET 环境, Mono 5.16.0 + Jexus 5.8
- BZOJ4477[Jsoi2015]字符串树——可持久化trie树
- android_安装包_NoClassDefFoundError
- http认证中的nonce与timestamp解释
- 13.11.20 jquery 核心 siblings() 获得同类(不包含自己)循环所有,