2015-03-14 | 折腾

mac批量操作文件

下载了 material-design-icons,使用时一个一个复制太麻烦

只要一行代码~

1
2
3
➜  ~$cd material-design-icons-1.0.1/action/

➜ action$find drawable*/ -name "*ic_settings_grey600_48dp*" | xargs -I {} cp {} ~/AndroidStudioProjects/XXXXX/app/src/main/res/{}

啊哈

复制完成~

主要是find命令和xargs命令, linux 下面可能有些地方不一样,但是影响不大

1
2
3
4
➜  ~$xargs
xargs: illegal option -- husage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
[-L number] [-n number [-x]] [-P maxprocs] [-s size]
[utility [argument ...]]
1
2
3
➜  ~$find
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]

其它用到时再学