In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the use of the pv command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The abbreviation of Linux common command pv command Pipe Viewer, developed by Andrew Wood. It means to display information about the progress of data processing through a pipeline. This information includes the time elapsed, the percentage completed (shown by the progress bar), the current speed, all data transferred, and the estimated remaining time.
Pv displays progress information about commands currently executed on the command line, pipe viewer
Download and install # Debian operating system, such as Ubuntu sudo apt-get install pv # RedHat operating system: yum install pv syntax pv (option) (parameter) pv [OPTION] [FILE]. Option-p,-- progress shows progress bar-t,-- timer shows elapsed time-e,-- eta shows estimated time of arrival (completed)-I,-- fineta shows absolute estimated time of arrival (completed)-r -- format FORMAT sets the output format to FORMAT-n,-- percentage of numeric output-Q,-- quiet does not output any information-W,-- wait does not display anything until the first byte is transmitted-D,-- delay-start SEC does not display anything until the SEC second has elapsed.-s -- size SIZE sets the estimated data size to SIZE bytes-l,-- line-mode calculates rows instead of bytes-0,-- null lines end with zero-I,-- interval SEC updates every SEC second-width WIDTH assumes that the width of the terminal is WIDTH characters-H -- height HEIGHT assumes that the terminal height is HEIGHT line-N,-- name NAME adds the name-f before the visual information,-- force outputs the standard error to terminal-c,-- cursor uses the cursor to locate the escape sequence-L,-- rate-limit RATE limits transmission to RATE bytes per second-B -- buffer-size BYTES uses the buffer size of BYTES-C,-- no-splice never uses splice () Always use read / write-E,-- skip-errors to skip read error in input-S,-- stop-at-size transfer-- stop after size bytes,-- remote PID update process PID settings-P,-- pidfile FILE save process ID in FILE-d,-- watchfd PID [: FD] monitor process PID, open file FD-h If you use cp to accomplish the above tasks, you will not know anything until the whole replication process is over or something goes wrong.
# there will be progress in copying files linux [master ●]% pv ~ / Downloads/CentOS-7-x86_64-Minimal-1511.iso > ~ / Desktop/CentOS-7-x86_64-Minimal-1511.iso # enter information below 552MiB 0:00:02 [212MiB/s] [= >] 91% ETA 0:00:00 #-L allows you to modify the transfer rate of the pv command. # use the-L option to limit the transfer rate to 2MB/s. Pv-L 2m / media/himanshu/1AC2-A8E3/fNf.mkv >. / Desktop/fnf.mkv # characters are displayed one by one at a uniform speed on the command line echo "Tecmint [dot] com is a community of Linux Nerds and Geeks" | pv-qL 10 # compressed file displays progress information pv / media/himanshu/1AC2-A8E3/fnf.mkv | gzip >. / Desktop/fnf.log.gz # write iso to disk with the dd command Pv to achieve the progress bar display sudo pv-cN source sudo dd of=/dev/disk2 bs=4m # # shows the following progress source: 5.2GiB 5:11:41 [503KiB/s] [= >] 71% ETA 2:01:56 on linux, if some commands or scripts take a long time to execute, but can not spend more energy repeatedly staring at the end of execution, you can use pv to listen to PID Notify Wechat or nails through the network after the task is completed, so that you can free up energy to do other things, isn't it great?
$pv-d $(ps-ef | grep-v grep | grep "" | awk'{print $2}') & & Note the option "- d,-watchfd PID [: FD]", which is only available in 1.6.6. If you use pv, you need to upgrade to a version greater than or equal to 1.6.6.
The latest version of pv in CentOS7's Yum warehouse is 1.4.6, and version 1.6.6 is released in CentOS8. If necessary, you can download the pv in CentOS8 to your local computer or local Yum private server. This is the download address, which can be downloaded according to your own architecture. 1.6.6 installation: rpm-ivh pv-1.6.6-7.el8.x86_64.rpm-U
Thank you for reading this article carefully. I hope the article "what is the use of pv commands in Linux" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.