Back to Ohmyzsh

Systemadmin plugin

plugins/systemadmin/README.md

latest5.4 KB
Original Source

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:

zsh
plugins=(... systemadmin)

Aliases

AliasCommandDescription
pingping -c 5Sends only 5 ICMP Messages
ping6ping6 -c 5Sends only 5 ICMPv6 Messages
clrclear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.Clears the screen and prints the current user, TTY, and directory
pathprint -l $pathDisplays PATH with each entry on a separate line
mkdirmkdir -pvAutomatically create parent directories and display verbose output
psmemps -e -orss=,args= | sort -b -k1 -nrDisplay the processes using the most memory
psmem10ps -e -orss=,args= | sort -b -k1 -nr | head -n 10Display the top 10 processes using the most memory
pscpups -e -o pcpu,cpu,nice,state,cputime,args |sort -k1 -nrDisplay the top processes using the most CPU
pscpu10ps -e -o pcpu,cpu,nice,state,cputime,args |sort -k1 -nr | head -n 10Display the top 10 processes using the most CPU
hist10print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10Display the top 10 most used commands in the history

Functions

FunctionDescription
dlsList only directories in the current directory
psgrepList all processes that match the pattern input after the command
killitKills any process that matches a regular expression passed to it
treeList contents of directories in a tree-like format (if tree isn't installed)
sortconsSort connections by state
con80View all 80 Port Connections
sortconipOn the connected IP sorted by the number of connections
req20List the top 20 requests on port 80
http20List the top 20 connections to port 80 based on tcpdump data
timewait20List the top 20 time_wait connections
syn20List the top 20 SYN connections
port_proOutput all processes according to the port number
accessip10List the top 10 accesses to the ip address in the nginx/access.log file or another log file if specified
visitpage20List the top 20 most visited files or pages in the nginx/access.log file or another log file if specified
consume100List the 100 most time-consuming Page lists (more than 60 seconds) as well as the corresponding number of occurrences
webtrafficList website traffic statistics in GB from the nginx/access.log file or another log file if specified
c404List statistics on 404 connections in the nginx/access.log file or another log file if specified
httpstatusList statistics based on http status in the nginx/access.log file or another log file if specified
d0Delete 0 byte files recursively in the current directory or another if specified
geteipGather information regarding an external IP address using icanhazip.com
getipDetermine the local IP Address with ip addr or ifconfig
clrzClear zombie processes
conssecShow number of concurrent connections per second based on nginx/access.log file or another log file if specified