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 {} \; 

[Bash] Find Files and Folders with `find` in Bash的更多相关文章

  1. [Bash] View Files and Folders in Bash

    Sometimes when working at the command line, it can be handy to view a file’s contents right in the t ...

  2. Mac OS finder : 显示和隐藏文件[夹] show and hide files or folders

    Finder默认是不显示隐藏文件[夹]的,要显示出怎么办? 要显示的话,可以GUI(graphic user interface)和CLI(command line interface)两种方式 CL ...

  3. Track files and folders manipulation in Windows

    The scenario is about Business Secret and our client do worry about data leakage. They want to know ...

  4. Bash: about .bashrc, .bash_profile, .profile, /etc/profile, etc/bash.bashrc and others

    Some interesting excerpts from the bash manpage:When bash is invoked as an interactive login shell, ...

  5. [Bash] Move and Copy Files and Folders with Bash

    In this lesson we’ll learn how to move and rename files (mv) and copy (cp) them. Move index.html to ...

  6. [转]COPY OR MOVE FILES AND FOLDERS USING OLE AUTOMATION

    本文转自:http://sqlindia.com/copy-move-files-folders-using-ole-automation-sql-server/ I love playing aro ...

  7. bash guide

    Table of Contents Basic Operations 1.1. File Operations 1.2. Text Operations 1.3. Directory Operatio ...

  8. linux shell & bash

    shell & bash shell指允许用户通过文本操作计算机的程序. interactive shell:从是否通过标准输入输出与用户进行交互的角度分为交互式shell(interacti ...

  9. powershell与linux bash对比

    转自Github/Powershell Bash PowerShell Description ls dir, Get-ChildItem List files and folders tree di ...

随机推荐

  1. SoapUI对于Json数据进行属性值获取与传递

    SoapUI的Property Transfer功能可以很好地对接口请求返回的数据进行参数属性获取与传递,但对于Json数据,SoapUI会把数据格式先转换成XML格式,但实际情况却是,转换后的XML ...

  2. Java中的枚举--Enumeration

    之前并没有注意到枚举这个知识点,因为之前在项目中并没有使用过枚举,可能是项目并不是很复杂的原因吧,今天看张孝祥老师的讲解,觉得,这个枚举真的有很多值得学习的地方,探究一下枚举的设计原理,底层到底是怎么 ...

  3. ICPC-Beijing 2006 狼抓兔子

    题目描述 题解: 裸的最小割. 但是最大流跑不过去怎么办? 转变一下,既然最大流是一条左下<->右上的通路,我们可以把图划分为若干区域, 最后找左下到右上的最短路就行了. 代码: #inc ...

  4. SDOI2011 拦截导弹

    题目描述 题解: 对于第一问,我们求二维LIS即可; 对于第二问,我们可以记录向前最长长度,向前最长方案数,向后最长长度,向后最长方案数. 其实改改树状数组即可. 还有,方案数一定要开double. ...

  5. BeautifulSoup与aiohttp的简单应用-爬取《网上中华五千年》音频

    香港电台的节目素质都比较不错,其中有个<中华五千年>的节目是以情景剧与旁白的形式来展示历史故事,由传说时代一直到民国,1983年首播至2000年,非常长寿的一个节目.网上能找到版本声音非常 ...

  6. 牛客网暑期ACM多校训练营(第四场) J 贪心

    链接: https://www.nowcoder.com/acm/contest/143/J #include<bits/stdc++.h> using namespace std; lo ...

  7. Python工程师面试题目

    1.请尽可能列举python列表的成员方法,并给出一下列表操作的答案: len() 返回列表中的元素数量. max() 返回列表中的最大元素.最大元素的判断依据是列表中的对象类型.数字列表中的最大元素 ...

  8. UVALive 2957 Bring Them There

    Bring Them There Time Limit: 3000ms Memory Limit: 131072KB This problem will be judged on UVALive. O ...

  9. [codeforces551E]GukiZ and GukiZiana

    [codeforces551E]GukiZ and GukiZiana 试题描述 Professor GukiZ was playing with arrays again and accidenta ...

  10. bzoj 2337 高斯消元+概率DP

    题目大意: 每条路径上有一个距离值,从1走到N可以得到一个所有经过路径的异或和,求这个异或和的数学期望 这道题直接去求数学期望的DP会导致很难列出多元方程组 我们可以考虑每一个二进制位从1走到N的平均 ...