cpy-cli - cpコマンドをほんの少し便利に

cpy-cli - cpコマンドをほんの少し便利に:

Linuxなどでディレクトリをコピーする際に使うのがcpコマンドです。ごくごく基本的なコマンドなので使うのは簡単ですが、あまり融通が効かなかったりします。そのため、一旦コピーしてから別途ファイル操作を行うと言った人もいるのではないでしょうか。

そこで使ってみて欲しいのがcpy-cliです。cpコマンドをちょっと便利にしてくれるソフトウェアです。

cpy-cliの使い方

一例です。!を付けると除外対象になります。

$ cpy 'assets/*.gif' '!assets/css' data/ 
ヘルプです。リネームなどもできます。

$ cpy --help 
 
  Copy files 
 
  Usage 
    $ cpy <source />... <destination> 
 
  Options 
    --no-overwrite       Don't overwrite the destination 
    --parents            Preserve path structure 
    --cwd=<dir>          Working directory for files 
    --rename=<filename>  Rename all <source /> filenames to </filename><filename> 
 
  <source /> can contain globs if quoted 
 
  Examples 
    Copy all .png files in src folder into dist except src/goat.png 
    $ cpy 'src/*.png' '!src/goat.png' dist 
 
    Copy all .html files inside src folder into dist and preserve path structure 
    $ cpy '**/*.html' '../dist/' --cwd=src --parents 
cpy-cliはnodeで作られており、ごくごく基本的な使い方としてはcpコマンドと変わりません。しかしパターンを用いることで少しだけ便利にしてくれます。意外とありそうでなかったソフトウェアと言えます。こういうコマンド拡張のようなソフトウェアは自分用として便利そうです。

cpy-cliはnode/JavaScript製のオープンソース・ソフトウェア(MIT)です。

sindresorhus/cpy-cli: Copy files

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)