One, the demand for the query file named Zrsh beginning of time for July to date all files and packaging
1. The first thought is the Find + Xargs + CP format.
Find 2016073*-type f-name *zrsh\* |xargs cp {}./data/
After the execution found that the query file is not a directory, very surprised, so directly execute find 2016073*-type f-name *zrsh\* files are queried out without any problems.
2. Speculation is the CP when there are unexpected problems occur. So the direct CP test message. Found a space in the file name, the default is the space behind the part of the file name as a directory error.
Find 2016072*-type f-name *zrsh\* -print |xargs cp {}./data/do say file name too long
Find 2016072*-type f-name *zrsh\*-print |xargs -i cp {}./data/
3. After execution still error, found CP when there is no space in the file with the integration. When you execute the CP separately, enclose the file name in double quotation marks to execute directly.
Find 2016072*-type f-name *zrsh\*-print |xargs-i cp ' {} ' ./data/success.
4. Tar Package
TAR-ZCVF data.tar.gz Data
Find + Xargs + CP encounters with whitespace in file name handling