Files
oh-my-zsh/plugins/systemadmin/README.md
T
Robby RussellandClaude Fable 5.1 e92273d8b6 feat(systemadmin)!: match ports 80 and 443 in con80, req20 and http20
The three helpers hard-coded port 80. Most web traffic is HTTPS now, so
counting port 80 alone misses most of it. With no argument they now
match 80 and 443 together; passing one or more ports narrows them to
those (`con80 8080 8443`).

http20 also moves -c before the filter expression, since BSD getopt
stops at the first non-option argument.

BREAKING CHANGE: con80, req20 and http20 now include port 443 by
default. Pass the port explicitly (`con80 80`) to get the old behavior.

Closes #14114

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 13:38:08 -07:00

5.4 KiB

Systemadmin plugin

This plugin adds a series of aliases and functions which make a System Administrator's life easier.

To use it, add systemadmin to the plugins array in your zshrc file:

plugins=(... systemadmin)

Aliases

Alias Command Description
ping ping -c 5 Sends only 5 ICMP Messages
ping6 ping6 -c 5 Sends only 5 ICMPv6 Messages
clr clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD. Clears the screen and prints the current user, TTY, and directory
path print -l $path Displays PATH with each entry on a separate line
mkdir mkdir -pv Automatically create parent directories and display verbose output
psmem ps -e -orss=,args= | sort -b -k1 -nr Display the processes using the most memory
psmem10 ps -e -orss=,args= | sort -b -k1 -nr | head -n 10 Display the top 10 processes using the most memory
pszombie ps -eo user,pid,ppid,state,comm | awk '$4=="Z"' List zombie processes with ownership and parent process details
pscpu ps -e -o pcpu,cpu,nice,state,cputime,args |sort -k1 -nr Display the top processes using the most CPU
pscpu10 ps -e -o pcpu,cpu,nice,state,cputime,args |sort -k1 -nr | head -n 10 Display the top 10 processes using the most CPU
hist10 print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10 Display the top 10 most used commands in the history

Functions

Function Description
dls List only directories in the current directory
psgrep List all processes that match the pattern input after the command
killit Kills any process that matches a regular expression passed to it
tree List contents of directories in a tree-like format (if tree isn't installed)
sortcons Sort connections by state
con80 View all connections on ports 80 and 443, or on the ports given as arguments (con80 8080)
sortconip On the connected IP sorted by the number of connections
req20 List the top 20 requests on ports 80 and 443, or on the ports given as arguments (req20 8080)
http20 List the top 20 connections to ports 80 and 443 based on tcpdump data, or to the ports given as arguments
timewait20 List the top 20 time_wait connections
syn20 List the top 20 SYN connections
port_pro Output all processes according to the port number
accessip10 List the top 10 accesses to the ip address in the nginx/access.log file or another log file if specified
visitpage20 List the top 20 most visited files or pages in the nginx/access.log file or another log file if specified
consume100 List the 100 most time-consuming Page lists (more than 60 seconds) as well as the corresponding number of occurrences
webtraffic List website traffic statistics in GB from the nginx/access.log file or another log file if specified
c404 List statistics on 404 connections in the nginx/access.log file or another log file if specified
httpstatus List statistics based on http status in the nginx/access.log file or another log file if specified
d0 Delete 0 byte files recursively in the current directory or another if specified
geteip Gather information regarding an external IP address using icanhazip.com
getip Determine the local IP Address with ip addr or ifconfig
conssec Show number of concurrent connections per second based on nginx/access.log file or another log file if specified