mac下progress显示后台命令执行进度

env

  • mac
  • progress

step

1.install

brew install progress

2.help

➜  ~ progress --help                                 
progress - Coreutils Viewer
---------------------
Shows progress on file manipulations (cp, mv, dd, ...)

Monitored commands (default, you can add virtually anything):
cp mv dd tar bsdtar cat rsync scp grep fgrep egrep cut sort cksum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum adb gzip gunzip bzip2 bunzip2 xz unxz lzma unlzma 7z 7za zip unzip zcat bzcat lzcat coreutils split gpg gcp gmv 

Usage: progress [-qdwmM] [-W secs] [-c command] [-p pid]
  -q --quiet                   hides all messages
  -d --debug                   shows all warning/error messages
  -w --wait                    estimate I/O throughput and ETA (slower display)
  -W --wait-delay secs         wait 'secs' seconds for I/O estimation (implies -w, default=1.0)
  -m --monitor                 loop while monitored processes are still running
  -M --monitor-continuously    like monitor but never stop (similar to watch progress)  ### 持续监控命令
  -a --additional-command cmd  add additional command to default command list
  -c --command cmd             monitor only this command name (ex: firefox)  ### 监控特定命令
  -p --pid id                  monitor only this process ID (ex: `pidof firefox`)  ### 监控pid
  -i --ignore-file file        do not report process if using file
  -o --open-mode {r|w|u}       report only files opened for read, write, or read and write
  -v --version                 show program version and exit
  -h --help                    display this help and exit

Multiple options allowed for: -a -c -p -i. Use PROGRESS_ARGS for permanent arguments.

3.test cp

progress -M  -c cp

cp xxx  /tmp/