Jruls

Jul 20, 2023

Display and update FreeBSD jails resource usage

A top-alike utility to display and update FreeBSD jails resource usage, given RACCT/RCTL is enabled with kern.racct.enable=1 loader tunable.


FreeBSD is well-known for its robust and reliable software library, the ports collection. Among the thousands of applications in this library sits a hidden gem called “jruls,” categorized under sysutils. Here, we will delve into how to use it, its benefits, and why it is worth considering for your needs.

What’s jruls?

[jruls]https//www.freebsd.org/ports/ is a valuable tool under the sysutils category of FreeBSD ports collection. Designed to aid system administrators in maintaining and understanding the status of their filesystems, Jruls is lightweight, simple, yet highly effective in what it does.

At its core, jruls provides a real-time view of the system’s internal data, generated by constructing a hierarchy of your system’s files - think of it as a “file system explorer” for your UNIX-like operating system. It’s designed to offer a comprehensive understanding of how files and directories occupy disk space, which is critical in storage management and optimization.

Installation

Let’s dive into how to begin using jruls. The initial step is installing the port. FreeBSD makes this process straightforward with its ports snap

cd /usr/ports/sysutils/jruls/ && make install clean

After the installation completes, you can run jruls by simply typing its name into your terminal

jruls

Usage

The main feature of jruls is its ability to generate a live, visual hierarchical directory tree of the system. Here’s a simple demonstration of using jruls to see the file structure of the /usr directory

jruls /usr

As you navigate through the output, you’ll notice that files and directories are organized in an orderly manner, making it simpler to understand how space is distributed among them.

Options

Like many UNIX-like tools, jruls comes with several options to tailor its functionality to your requirement. Here are a few key ones worth knowing

  • -a Lists all files, including hidden ones.
  • -s Sorts files and directories by size.
  • -r Recursively explores subdirectories to an unlimited depth.

For instance, to view all files including hidden ones in your /usr directory, sorted by size, you would type

jruls -as /usr

Why Jruls?

The strength of jruls lies in its simplicity, efficiency, and ease of use. It’s a straightforward tool that does one job and does it well. With it, you can easily discern which directories or files are consuming the most space on your system, enabling you to free up disk space and optimize filesystems efficiently.

If you’re familiar with the du or the ‘disk usage’ command in UNIX-like systems, you’ll find jruls is a more interactive, user-friendly alternative. Whereas du outputs the consumption statistics of directories in a lackluster text format, jruls portrays the same data in a visually saturated hierarchical directory tree, making it a more preferred choice.

For those invested in IT security, consider utilizing [nmap]https//freebsdsoftware.org/security/nmap.html, another FreeBSD port, designed for discovering hosts, services, and systems on a computer network – an excellent companion to jruls when maintaining a secure server environment.

In conclusion, jruls is an underrated yet powerful tool that simplifies file and directory management. Whether you’re a system administrator or a casual FreeBSD user wishing for a visual representation of disk usage, consider giving jruls a try. It could be the tool you never knew you needed.


Checkout these related ports:
  • Zxfer - Easily and reliably transfer ZFS filesystems
  • Ztop - Display ZFS dataset I/O in real time
  • Zsm - ZFS Snapshot Manager
  • Zsd - Destroys ZFS snapshots
  • Zrepl - ZFS dataset replication tool
  • Zrep - ZFS based replication and failover solution
  • Zpool-iostat-viz - ZFS pool I/O latency statistics
  • Zoxide - Fast cd alternative that learns your habits
  • Zogftw - Creates redundant backups on encrypted ZFS pools
  • Znapzend - ZFS-centric backup tool
  • Zisofs-tools - User utilities for zisofs
  • Zidrav - File corruption detection and repair program
  • Zfstools - OpenSolaris-compatible auto snapshotting for ZFS
  • Zfsnap2 - Portable performant script to make rolling ZFS snapshots easy
  • Zfsnap - Simple sh script to make zfs rolling snaphosts with cron