目錄
What is Progress?
How Does Progress Work?
Installing Progress
Building from Source
Leveraging the Power of Progress
1. Monitoring Coreutils Commands
2. Monitoring Download Progress
3. Monitoring Web Server Activity
4. Monitoring Heavy Commands
Conclusion
首頁 系統教程 Linux Coreutils進度查看器:用於實時監視Coreutils命令的強大工具

Coreutils進度查看器:用於實時監視Coreutils命令的強大工具

Mar 23, 2025 am 09:14 AM

Coreutils Progress Viewer: A Robust Tool For Real-time Monitoring Of Coreutils Commands

As the world increasingly embraces open-source software, Linux has become a favorite among many tech enthusiasts. Its flexibility, security, and extensive customization options have made it a go-to for developers and system administrators alike. One of the many strengths of Linux lies in its robust command-line interface (CLI) that can be augmented with a variety of utilities. Today, we delve into the world of one such utility that enhances the CLI experience - Progress, formerly known as cv (Coreutils Viewer).

Table of Contents

What is Progress?

Progress is a tiny yet powerful tool designed to monitor and display the progress of coreutils basic commands (cp, mv, dd, tar, gzip, gunzip, cat, etc.) currently running on your system.

Progress displays the percentage of copied data, and can even estimate the time and throughput. For users seeking constant monitoring, it also provides a 'top-like' mode.

The Progress tool is an open-source, free application developed using the C programming language. It is designed to be compatible with multiple platforms, including Linux, FreeBSD, and macOS.

How Does Progress Work?

Progress operates by scanning /proc for interesting commands. It then inspects directories fd and fdinfo to find opened files and seek positions, subsequently reporting the status for the largest file. On macOS, it performs the same operations using libproc.

Despite its extensive capabilities, progress is very light and compatible with virtually any command.

Installing Progress

The installation process for Progress is straightforward and depends on the type of system you're using.

For Debian-based systems (Debian, Ubuntu, Mint, etc.), open a terminal and run:

$ sudo apt install progress
登入後複製

If you're using Arch Linux, EndeavourOS and Manjaro Linux, open a terminal and execute:

$ sudo pacman -S progress
登入後複製

Fedora users can install progress by opening a terminal and typing:

$ sudo dnf install progress
登入後複製

For openSUSE, open a terminal and enter:

$ sudo zypper install progress
登入後複製

On macOS with Homebrew, open a terminal and run:

$ brew install progress
登入後複製

If you prefer MacPorts on macOS, open a terminal and type:

$ sudo port install progress
登入後複製

Building from Source

For those who prefer building from the source, the process is simple.

Ensure that you have the necessary build tools and libraries installed on your system. Refer the following link to install development tools.

How To Install Development Tools In Linux

Next, download the source code for progress:

$ git clone https://github.com/Xfennec/progress.git
登入後複製

Navigate to the directory where the source code is clone.

$ cd progress
登入後複製

Run the following command to compile and install progress:

$ make && sudo make install
登入後複製

If you're using FreeBSD, use 'gmake' instead of 'make'.

If you encounter any errors related to missing ncurses library while building from source, you need to install Ncurses in your Linux system.

Depending on your distribution, use the appropriate package manager to install the necessary ncurses packages. For example:

For Debian-based systems, use:

$ sudo apt install libncurses5-dev
登入後複製

For Arch Linux, use:

$ sudo pacman -S ncurses
登入後複製

For Fedora, use:

$ sudo dnf install ncurses-devel
登入後複製

Leveraging the Power of Progress

Progress can be used in a myriad of ways to monitor your system. Let me show you a few examples.

1. Monitoring Coreutils Commands

To monitor all current and upcoming instances of coreutils commands in a simple window, enter the following command:

$ watch progress -q
登入後複製

2. Monitoring Download Progress

To monitor the progress of your downloads while using Firefox, execute the following command:

$ watch progress -wc firefox
登入後複製

3. Monitoring Web Server Activity

To keep an eye on your web server activity, type the following command:

$ progress -c httpd
登入後複製

4. Monitoring Heavy Commands

We can launch and monitor any heavy command using $!. Take a look at the following example.

$ cp bigfile newfile & progress -mp $!
登入後複製

Let us break down the above command and see what each option does.

  1. cp bigfile newfile &: This command copies a file named bigfile to a new file named newfile. The ampersand & at the end runs the command in the background, allowing the user to continue to use the shell without waiting for the command to complete.
  2. progress -mp $!: This command uses the progress utility to monitor the progress of the most recent background process. Here is what the flags do:
    • -m enables monitor mode, which refreshes the progress stats in real time until the tracked process finishes.
    • -p tells progress to monitor the specific process ID (PID).
    • $! is a special shell variable that holds the PID of the most recently executed background process.

So, to summarize, the whole command is copying a file in the background and simultaneously monitoring the progress of this copy operation using the progress utility.

The possibilities with Progress are extensive and can be tailored to fit your needs.

Related Read:

  • Advanced Copy – Add Progress Bar To cp And mv Commands In Linux
  • How To Monitor The Progress Of Data Through A Pipe Using ‘pv’ Command

Conclusion

The Progress utility is an useful tool that provides a straightforward and efficient way to monitor various processes and activities on your system. Whether you need to track the progress of downloads, monitor web server activity, observe the execution of heavy commands, or keep an eye on coreutils commands, Progress offers a range of functionalities to suit your needs.

By offering valuable insights into command execution, Progress aids in system monitoring and performance evaluation. If you are a developer, system administrator, or simply a tech enthusiast looking to leverage the power of command-line utilities, Progress can be a significant addition to your toolkit.

As with any tool, the best way to truly appreciate its capabilities is by using it. So, give Progress a try, and discover a new level of command-line efficiency.

Resource:

  • Progress GitHub Repository

以上是Coreutils進度查看器:用於實時監視Coreutils命令的強大工具的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1658
14
CakePHP 教程
1415
52
Laravel 教程
1309
25
PHP教程
1257
29
C# 教程
1231
24
Linux的5個基本組件是什麼? Linux的5個基本組件是什麼? Apr 06, 2025 am 12:05 AM

Linux的五個基本組件是:1.內核,管理硬件資源;2.系統庫,提供函數和服務;3.Shell,用戶與系統交互的接口;4.文件系統,存儲和組織數據;5.應用程序,利用系統資源實現功能。

Linux最有用的是什麼? Linux最有用的是什麼? Apr 09, 2025 am 12:02 AM

Linux在服務器、嵌入式系統和桌面環境中的應用廣泛。 1)在服務器領域,Linux因其穩定性和安全性成為託管網站、數據庫和應用的理想選擇。 2)在嵌入式系統中,Linux因其高度定制性和高效性而受歡迎。 3)在桌面環境中,Linux提供了多種桌面環境,滿足不同用戶需求。

如何學習Linux基礎知識? 如何學習Linux基礎知識? Apr 10, 2025 am 09:32 AM

Linux基礎學習從零開始的方法包括:1.了解文件系統和命令行界面,2.掌握基本命令如ls、cd、mkdir,3.學習文件操作,如創建和編輯文件,4.探索高級用法如管道和grep命令,5.掌握調試技巧和性能優化,6.通過實踐和探索不斷提陞技能。

Linux操作是什麼? Linux操作是什麼? Apr 13, 2025 am 12:20 AM

Linux操作系統的核心是其命令行界面,通過命令行可以執行各種操作。 1.文件和目錄操作使用ls、cd、mkdir、rm等命令管理文件和目錄。 2.用戶和權限管理通過useradd、passwd、chmod等命令確保系統安全和資源分配。 3.進程管理使用ps、kill等命令監控和控制系統進程。 4.網絡操作包括ping、ifconfig、ssh等命令配置和管理網絡連接。 5.系統監控和維護通過top、df、du等命令了解系統運行狀態和資源使用情況。

互聯網在Linux上運行嗎? 互聯網在Linux上運行嗎? Apr 14, 2025 am 12:03 AM

互聯網運行不依賴單一操作系統,但Linux在其中扮演重要角色。 Linux廣泛應用於服務器和網絡設備,因其穩定性、安全性和可擴展性受歡迎。

Linux的缺點是什麼? Linux的缺點是什麼? Apr 08, 2025 am 12:01 AM

Linux的缺點包括用戶體驗、軟件兼容性、硬件支持和學習曲線。 1.用戶體驗不如Windows或macOS友好,依賴命令行界面。 2.軟件兼容性不如其他系統,缺乏許多商業軟件的原生版本。 3.硬件支持不如Windows全面,可能需要手動編譯驅動程序。 4.學習曲線較陡峭,掌握命令行操作需要時間和耐心。

Linux難以學習嗎? Linux難以學習嗎? Apr 07, 2025 am 12:01 AM

Linuxisnothardtolearn,butthedifficultydependsonyourbackgroundandgoals.ForthosewithOSexperience,especiallycommand-linefamiliarity,Linuxisaneasytransition.Beginnersmayfaceasteeperlearningcurvebutcanmanagewithproperresources.Linux'sopen-sourcenature,bas

Linux管理員的薪水是多少? Linux管理員的薪水是多少? Apr 17, 2025 am 12:24 AM

Linux管理員的平均年薪在美國為75,000至95,000美元,歐洲為40,000至60,000歐元。提升薪資可以通過:1.持續學習新技術,如雲計算和容器技術;2.積累項目經驗並建立Portfolio;3.建立職業網絡,拓展人脈。

See all articles