Version 3 (modified by jazz, 7 years ago) (diff) |
---|
2018-02-21
xargs , find
- 常常忘記 xargs 怎麼把 STDIN 的結果拿來當後續指令的參數, 備忘一下:使用 -I 參數
- 參考: https://unix.stackexchange.com/questions/90886/how-can-i-find-files-and-then-use-xargs-to-move-them
find /tmp/ -ctime -1 -name "x*" | xargs -I '{}' mv '{}' ~/play/
- 參考: https://unix.stackexchange.com/questions/90886/how-can-i-find-files-and-then-use-xargs-to-move-them
- 當然也可以用 find 指令自己的 -exec 參數
find /tmp/ -ctime -1 -name "x*" -exec mv '{}' ~/play/
休假攻略
Attachments (2)
- 2018休假攻略.jpg (155.4 KB) - added by jazz 7 years ago.
- 2018休假年曆.jpg (438.9 KB) - added by jazz 7 years ago.
Download all attachments as: .zip