How can I remove all "name" files in all of my subdirectories on Linux
来源:互联网 发布:js动态增加style属性 编辑:程序博客网 时间:2024/04/29 11:40
Remove all *.swp files underneath the current directory, use the find
command in one of the following forms:
find . -name \*.swp -type f -delete
The-delete
option means find will directly delete the matching files. This is the best match to OP's actual question.
Using-type f
means find will only process files.find . -name \*.swp -type f -exec rm -f {} \;
find . -name \*.swp -type f -exec rm -f {} +
Option-exec
allows find to execute an arbitrary command per file. The first variant will run the command once per file, and the second will run as few commands as possible by replacing{}
with as many parameters as possible.find . -name \*.swp -type f -print0 | xargs -0 rm -f
Piping the output toxargs
is used form more complex per-file commands than is possible with-exec
. The option-print0
tellsfind
to separate matches with ASCII NULL instead of a newline, and-0
tellsxargs
to expect NULL-separated input. This makes the pipe construct safe for filenames containing whitespace.
- How can I remove all "name" files in all of my subdirectories on Linux
- How can i get hold of all of the visible items in my QListView?
- Display a Directory Tree of all Subdirectories and Files
- How can I access my files via FTP on Ubuntu?
- How can I make my existing HTML files work in XML?
- how to remove all subviews from my scrollview
- How can I create ePub files from my books?
- How can I dump only certain entries of a table based on my condition?
- How can I put a checkbox in a column of my DataGrid?
- How do I remove all partitions, data and create clean empty hard disk under Linux operating systems?
- How can I handle hardware keys in my application?
- remove all provisioning files from xcode 7
- one command to delete all files with name "filename" in current dir and all its sub-dirs
- delete all the cvs files on XP
- How can I get the IPv4 address of an interface in linux from C code ?
- list all files of a pc
- iOS: Open In … All Files
- Read all files in a folder
- Android中ListView分页加载数据
- 在VS2010下配置 QT5
- oracle遍历树
- git patch
- horizon 实例列表中实例的操作出不来的原因和解决办法
- How can I remove all "name" files in all of my subdirectories on Linux
- iOS开发:如何使用ShareSDK让APP快速拥有分享功能
- 基础总结篇之四:Service完全解析
- ubuntu有线无线一起连
- GEF常见问题3:自身连接
- 当ListView有Header或footer时,onItemClick里的position不正确,可以用getAdapter()
- 跳棋
- zigbee计划
- 内部Handler类引起内存泄露