- 论坛徽章:
- 0
|
----------1, 问题来源, 把某个目录下(及其子目录下), 所有的txt文件, 整合到一个文件中
./201501/1.txt
./201502/1.txt
./201502/2.txt
./201503/1.txt
./201503/2.txt
./201503/3.txt
./201503/4.txt
./201504/1.txt
./201504/t_driver.txt
./201504/t_menu.txt
./201504/t_oper_log.txt
./201504/t_role.txt
./201504/t_role_menu.txt
./201504/t_server_capability.txt
./201504/t_server_capability_tree.txt
./201505/1.txt
-----------2. 实际做法
$ find . -type f -name "*.txt" -print0 |xargs -0 cat |wc
1752 6544 85642
ok, 要保存到文件中.
$ find . -type f -name "*.txt" -print0 |xargs -0 cat >1.txt
cat: ./1.txt:输入文件是输出文件
$ find . -type f -name "*.txt" -print0 |xargs -0 cat | cat >1.txt
这个就是ok的,
困惑了, 请 高手指点一下吧!!!! |
|