LinuxCommandLibrary

lsar

List contents of a macOS archive file

TLDR

List an archive file's contents

$ lsar [path/to/archive]
copy

List a password protected archive file's contents
$ lsar [path/to/archive] [[-p|--password]] [password]
copy

Print all available information about each file in the archive (it's very long)
$ lsar [[-L|--verylong]] [path/to/archive]
copy

Test the integrity of the files in the archive (if possible)
$ lsar [[-t|--test]] [path/to/archive]
copy

List the archive file's contents in JSON format
$ lsar [[-j|--json]] [path/to/archive]
copy

Display help
$ lsar [[-h|--help]]
copy

SYNOPSIS

sar [ options ] [ interval [ count ] ]
sar [ options ] -f filename

PARAMETERS

-A
    Report all activities. This is equivalent to specifying all available options.

-u
    Report CPU utilization statistics. The interval and count parameters specify the sampling rate and number of samples.

-r
    Report memory utilization statistics (e.g., free memory, used memory, buffer and cache sizes).

-b
    Report I/O and transfer rate statistics for block devices.

-d
    Report activity for each block device (e.g., read/write operations per second, average queue length).

-n {keyword | ALL}
    Report network statistics. Use keywords like 'DEV' (network interfaces), 'IP', 'TCP', 'UDP', 'SOCK' (sockets), or 'ALL' for comprehensive network data.

-q
    Report queue length and load averages (e.g., run queue length, number of tasks).

-w
    Report task creation and context switching statistics.

-W
    Report swapping activity statistics (e.g., pages swapped in/out).

-f filename
    Extract records from filename, which is a daily data file created by the sadc daemon or by sar -o.

-o filename
    Save the collected data in binary format to filename. This data can be viewed later using sar -f.

-s HH:MM:SS
    Set the starting time of the data collection for the report (inclusive).

-e HH:MM:SS
    Set the ending time of the data collection for the report (inclusive).

interval
    Time in seconds between each sample. Used for real-time data collection when no filename is specified.

count
    Number of samples to collect. Used for real-time data collection in conjunction with interval.

DESCRIPTION

sar (System Activity Reporter) is a powerful command-line utility for collecting, reporting, and saving system activity information. Part of the sysstat package, it monitors various system resources including CPU utilization, memory and swap usage, disk I/O, network activity, process statistics, and more.

It can display real-time performance data by specifying an interval and count, or analyze historical data stored in daily activity log files, usually located in /var/log/sysstat or /var/log/sa. sar is invaluable for system administrators and performance analysts to diagnose bottlenecks, track resource usage over time, and understand system behavior patterns. It provides a comprehensive view of system health and performance trends over time.

CAVEATS

The command 'lsar' is not a standard Linux command found in common distributions. This analysis assumes the user intended to inquire about the 'sar' (System Activity Reporter) command, a widely used utility for system performance monitoring and analysis. If 'lsar' refers to a custom script, an alias, or a command from a specific, non-standard software package, this information may not apply.

DAILY DATA FILES

By default, sar collects daily activity data through the sadc daemon (System Activity Data Collector) and stores it in binary format in files, typically found in /var/log/sysstat/saDD (where DD is the day of the month). These files are usually managed by cron jobs executing sa1 (daily data collection) and sa2 (daily report generation) scripts. These historical data files can be later analyzed using sar -f.

CONFIGURATION

The data collection frequency and retention policies for sar and the sysstat package are typically configured through files such as /etc/default/sysstat or /etc/sysstat/sysstat. These configuration files control the parameters for the cron jobs that run sa1 (to collect data) and sa2 (to generate daily reports), allowing administrators to tailor monitoring to their specific needs.

HISTORY

The sysstat package, which includes sar, has a long and influential history in Unix-like systems. It originated from System V Unix's performance tools, providing a standardized suite for system monitoring. sar specifically became a foundational tool for system administrators to track resource utilization, diagnose performance bottlenecks, and analyze system behavior over time. It has continually evolved, incorporating new metrics and capabilities to adapt to changing hardware architectures and operating system complexities, cementing its role as an indispensable utility for system performance management.

SEE ALSO

iostat(1), mpstat(1), vmstat(8), free(1), top(1), sadc(8), sa1(8), sa2(8)

Copied to clipboard