[Bash] Find Files and Folders with `find` in Bash
2018-10-15 14:38
756 查看
findis 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 {} \;
相关文章推荐
- Working with Linux Files and Folders in Bash
- 【Bash脚本】BASH script to find files exist in two folders
- [Bash] View Files and Folders in Bash
- [Bash] Move and Copy Files and Folders with Bash
- Multiple Files Upload in ASP.NET and ASP.NET with jQuery
- Java实现用最大堆和最小堆查找中位数 Find median with min heap and max heap in Java
- 利用webservice和.net技术上传和下载文件--Sending files in chunks with MTOM Web Services and .NET 2.0 from:http://www.codeproject.com/soap/MTO
- How to find and fix Bash Shell-shock vulnerability CVE-2014-6271 in unix like system
- open files in a directory and then find someword in the text tcl tk
- Sending files in chunks with MTOM Web Services and .NET 2.0
- Working with PDF files in C# using PdfBox and IKVM
- Working with CSV files in Bash
- upload files in rails with plugin and without plugin
- one command to delete all files with name "filename" in current dir and all its sub-dirs
- Upload files in ASP.NET MVC with JavaScript and C#
- Working with iPhone files and folders
- Find n‘th number in a number system with only 3 and 4
- Find n‘th number in a number system with only 3 and 4
- 'find' and 'locate' in linux to look up files
- How to delete subfolders and files in a folder