Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

批量文件操作 #9

Open
humingcheng opened this issue Aug 28, 2016 · 0 comments
Open

批量文件操作 #9

humingcheng opened this issue Aug 28, 2016 · 0 comments

Comments

@humingcheng
Copy link
Owner

humingcheng commented Aug 28, 2016

例如对多个文件进行读写、删除、压缩、转格式等。

以dos2unix为例

1,将目录中的所有文件转换格式
find /opt/test/ -type f -exec dos2unix {} ; #必须有分号
2,目录中的.c和.h文件
3,将目录中的所有文件转换格式,除了.html文件
4,将目录中的所有文件转换格式,除了子目录dir1,dir2。
5,将dir1,dir2...dirn目录中的所有文件转换格式
批量文件操作,例如压缩、删除、转换格式等。这些都可用find命令配合具体的命令来以rm命令为例

find /opt/test/ -type f -exec dos2unix {} ; #必须有分号
find也支持正则

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant