{"id":686,"date":"2024-11-10T11:58:23","date_gmt":"2024-11-10T08:58:23","guid":{"rendered":"https:\/\/itgen.itbumper.com\/?page_id=686"},"modified":"2024-11-10T12:28:09","modified_gmt":"2024-11-10T09:28:09","slug":"0015_useful-comands_draft","status":"publish","type":"page","link":"https:\/\/itgen.itbumper.com\/?page_id=686","title":{"rendered":"0015_progress"},"content":{"rendered":"<p style=\"text-align: justify;\" data-tadv-p=\"keep\">The <strong><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"8:8\">progress<\/span><\/strong> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"0:7\">utility<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"17:3\">for<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"21:12\">tracking<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"45:6\">command<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"34:10\">execution<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"52:1\">on<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"54:5\">Linux.<\/span><\/p>\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\"><strong>Can track process:<\/strong> <em>cp, mv, dd, tar, bsdtar, cat, rsync, scp, grep, fgrep, egrep, cut, sort, 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.<\/em><\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# Debian \/ Ubuntu Linux:\nsudo apt install progress\n\n# RHEL \/ CentOS Linux:\nsudo yum install progress\n\n# Fedora 22+:\nsudo dnf install progress\n\n# Alternative \ngit clone https:\/\/github.com\/Xfennec\/progress.git\ncd progress\nmake\nsudo make install\n<\/pre><\/div>\n\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\">Split a console using tmux or open another session. In the first console, run a command; in the second, run a command <strong>progress -w. <\/strong><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"0:2\">You<\/span> will <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"3:7\">see<\/span> the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"11:8\">progress<\/span> of the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"20:8\">process<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"29:2\">at<\/span> the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"32:6\">time<\/span> of <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"39:7\">running<\/span> the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"47:7\">command.<\/span><\/p>\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\">If you want to see progress in real-time, add &#8216;<strong>&amp; progress -mp $!<\/strong>&#8216; at the end of the command.<\/p>\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\"><strong>Example:<\/strong><\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncp ubuntu-23.04-desktop-amd64.iso \/home\/user\/Downloads\/\u00a0&amp; progress -mp $!\n<\/pre><\/div>\n\n<p><span style=\"text-decoration: underline;\"><strong>Some definitions:<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\"><strong>&amp;<\/strong> &#8211; is the character at the end of the cp command that indicates to run it in the background;<br><strong>-m<\/strong>&nbsp; &#8211; is a progress option that starts a cycle that will continue as long as the monitored processes remain active;<br><strong>-p<\/strong>&nbsp; &#8211; is an option that allows you to specify the process to be tracked;<br><strong>$!<\/strong>&nbsp; &#8211; is a special shell variable representing the PID of the last background process, in this case, the cp command.<\/p>\n<p><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"0:1\">On<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"2:8\">Linux<\/span>, <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"11:7\">commands<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"19:5\">can<\/span> be <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"25:11\">executed<\/span> in <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"37:11\">parallel<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"48:1\">.<\/span> Using&nbsp;the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"70:8\">progress<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"62:7\">utility<\/span>, <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"79:2\">you<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"82:6\">can<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"89:11\">track<\/span> the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"101:6\">work<\/span> of <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"114:4\">all<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"119:9\">available<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"129:6\">commands<\/span> at once<span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"135:1\">.<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"140:3\">For<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"144:7\">example<\/span>, let&#8217;s <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"152:8\">run<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"161:3\">three<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"186:6\">file<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"174:11\">copying<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"165:8\">operations<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"193:1\">and<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"195:8\">use<\/span> the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"215:5\">watch<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"204:10\">tool as an argument for<\/span>&nbsp;<span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"243:8\">which<\/span> we <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"252:6\">specify<\/span> the <strong><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"267:8\">progress<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"276:1\">&#8211;<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"277:1\">q<\/span><\/strong> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"259:7\">command.<\/span><\/p>\n<p><strong>Example:<\/strong><\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# update time is 2 seconds\nwatch progress -q\n# update time is every 1 second\nwatch -n 1 progress -q\n<\/pre><\/div>\n\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\">I prefer to split a console by using <em><strong>tmux. <\/strong><\/em>I run <em><strong>watch -n 1 progress -q<\/strong><\/em> in the bottom console and run commands at the top console by adding &amp; at the end of each command, and processes still work in the background. Depending on permissions, you have to use <strong>sudo.<\/strong>&nbsp;<\/p>\n<p><strong>Example:<\/strong><\/p>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"358\" src=\"https:\/\/itgen.itbumper.com\/wp-content\/uploads\/2024\/11\/progress_01.png\" alt=\"\" class=\"wp-image-690\" srcset=\"https:\/\/itgen.itbumper.com\/wp-content\/uploads\/2024\/11\/progress_01.png 550w, https:\/\/itgen.itbumper.com\/wp-content\/uploads\/2024\/11\/progress_01-300x195.png 300w\" sizes=\"(max-width: 550px) 85vw, 550px\" \/><\/figure><\/div>","protected":false},"excerpt":{"rendered":"<p>The progress utility for tracking command execution on Linux. Can track process: cp, mv, dd, tar, bsdtar, cat, rsync, scp, grep, fgrep, egrep, cut, sort, 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. Split a console using tmux &hellip; <a href=\"https:\/\/itgen.itbumper.com\/?page_id=686\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;0015_progress&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[21,33],"tags":[],"_links":{"self":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/686"}],"collection":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=686"}],"version-history":[{"count":7,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/686\/revisions"}],"predecessor-version":[{"id":703,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/686\/revisions\/703"}],"wp:attachment":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}