---
title: "xargs用法"
author: "ama2000"
date: "2012-10-30T19:52:52Z"
tags: []
categories: ["编程语言"]
slug: "xargs"
draft: false
lastmod: "2012-10-30T19:52:52Z"
id: 1709108
url: "https://ama2000.iteye.com/blog/1709108"
---

path=/home/xx/data/xx

 

ls path | xargs -n10 -i -t  cp {} {}.back

 

-n10 10个一组

-t 选项使用一个周详模式， 打印后面的动作

-i 用{} 占位符来引用匹配项