【发布时间】:2017-02-07 18:39:38
【问题描述】:
此代码背后的想法是查找大于 1KB(或 1000 字节)的目录中的所有文件,压缩它们,然后将它们从原始目录中删除。我能够找出两个单独的命令,但不确定如何将第一个命令的输出链接到第二个命令(如果有意义的话)?谁能指出我正确的方向?
# Initialize variables
dir=~/Test
# Change directory to $DIRECTORY
cd "$dir"
# Find all files in the current directory that are larger than 1000 bytes (1KB).
find . -maxdepth 1 -type f -size +1000c | zip -mT backup
【问题讨论】:
标签: linux bash shell scripting