目录
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
首页 系统教程 操作系统 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

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

<🎜>:泡泡胶模拟器无穷大 - 如何获取和使用皇家钥匙
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆树的耳语 - 如何解锁抓钩
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系统,解释
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++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教程
1667
14
CakePHP 教程
1426
52
Laravel 教程
1328
25
PHP教程
1273
29
C# 教程
1255
24
互联网在Linux上运行吗? 互联网在Linux上运行吗? Apr 14, 2025 am 12:03 AM

互联网运行不依赖单一操作系统,但Linux在其中扮演重要角色。Linux广泛应用于服务器和网络设备,因其稳定性、安全性和可扩展性受欢迎。

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 17, 2025 am 12:24 AM

Linux管理员的平均年薪在美国为75,000至95,000美元,欧洲为40,000至60,000欧元。提升薪资可以通过:1.持续学习新技术,如云计算和容器技术;2.积累项目经验并建立Portfolio;3.建立职业网络,拓展人脉。

Linux系统管理员的主要任务是什么? Linux系统管理员的主要任务是什么? Apr 19, 2025 am 12:23 AM

Linux系统管理员的主要任务包括系统监控与性能调优、用户管理、软件包管理、安全管理与备份、故障排查与解决、性能优化与最佳实践。1.使用top、htop等工具监控系统性能,并进行调优。2.通过useradd等命令管理用户账户和权限。3.利用apt、yum管理软件包,确保系统更新和安全。4.配置防火墙、监控日志、进行数据备份以确保系统安全。5.通过日志分析和工具使用进行故障排查和解决。6.优化内核参数和应用配置,遵循最佳实践提升系统性能和稳定性。

Linux的主要目的是什么? Linux的主要目的是什么? Apr 16, 2025 am 12:19 AM

Linux的主要用途包括:1.服务器操作系统,2.嵌入式系统,3.桌面操作系统,4.开发和测试环境。Linux在这些领域表现出色,提供了稳定性、安全性和高效的开发工具。

Linux和Windows之间虚拟化支持有哪些差异? Linux和Windows之间虚拟化支持有哪些差异? Apr 22, 2025 pm 06:09 PM

Linux和Windows在虚拟化支持上的主要区别在于:1)Linux提供KVM和Xen,性能和灵活性突出,适合高定制环境;2)Windows通过Hyper-V支持虚拟化,界面友好,与Microsoft生态系统紧密集成,适合依赖Microsoft软件的企业。

很难学习Linux吗? 很难学习Linux吗? Apr 18, 2025 am 12:23 AM

学习Linux并不难。1.Linux是一个开源操作系统,基于Unix,广泛应用于服务器、嵌入式系统和个人电脑。2.理解文件系统和权限管理是关键,文件系统是层次化的,权限包括读、写和执行。3.包管理系统如apt和dnf使得软件管理方便。4.进程管理通过ps和top命令实现。5.从基本命令如mkdir、cd、touch和nano开始学习,再尝试高级用法如shell脚本和文本处理。6.常见错误如权限问题可以通过sudo和chmod解决。7.性能优化建议包括使用htop监控资源、清理不必要文件和使用sy

Linux软件的未来:Flatpak和Snap会替换本机桌面应用程序吗? Linux软件的未来:Flatpak和Snap会替换本机桌面应用程序吗? Apr 25, 2025 am 09:10 AM

多年来,Linux软件分布依赖于DEB和RPM等本地格式,并深深地根深蒂固。 但是,Flatpak和Snap已经出现,有望成为应用程序包装的通用方法。 本文考试

See all articles