summaryrefslogtreecommitdiff
path: root/plugins/systemadmin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/systemadmin')
-rw-r--r--plugins/systemadmin/README.md22
-rw-r--r--plugins/systemadmin/systemadmin.plugin.zsh13
2 files changed, 18 insertions, 17 deletions
diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md
index edca4d87d..052fc6edc 100644
--- a/plugins/systemadmin/README.md
+++ b/plugins/systemadmin/README.md
@@ -10,17 +10,17 @@ plugins=(... systemadmin)
## Aliases
-| Alias | Command | Description |
-|---------|------------------------------------------------------------------------|--------------------------------------------------------------------|
-| ping | `ping -c 5` | Sends only 5 ICMP Messages |
-| clr | `clear; echo Currently logged in on $TTY, as $USER 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,1n` | Display the processes using the most memory |
-| psmem10 | `ps -e -orss=,args= \| sort -b -k1,1n \| head -10` | Display the top 10 processes using the most memory |
-| 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 -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 |
+| Alias | Command | Description |
+|---------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
+| ping | `ping -c 5` | Sends only 5 ICMP 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 -10` | Display the top 10 processes using the most memory |
+| 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 -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
diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
index bdc2219fa..a77f0069b 100644
--- a/plugins/systemadmin/systemadmin.plugin.zsh
+++ b/plugins/systemadmin/systemadmin.plugin.zsh
@@ -21,15 +21,15 @@ function retlog() {
}
alias ping='ping -c 5'
-alias clr='clear; echo Currently logged in on $TTY, as $USER in directory $PWD.'
+alias clr='clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.'
alias path='print -l $path'
alias mkdir='mkdir -pv'
# get top process eating memory
-alias psmem='ps -e -orss=,args= | sort -b -k1,1n'
-alias psmem10='ps -e -orss=,args= | sort -b -k1,1n| head -10'
+alias psmem='ps -e -orss=,args= | sort -b -k1 -nr'
+alias psmem10='ps -e -orss=,args= | sort -b -k1 -nr | head -10'
# get top process eating cpu if not work try excute : export LC_ALL='C'
-alias pscpu='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1 -nr'
-alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1 -nr | head -10'
+alias pscpu='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr'
+alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head -10'
# top10 of the history
alias hist10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
@@ -131,7 +131,8 @@ d0() {
# gather external ip address
geteip() {
- curl -s -S https://icanhazip.com
+ curl -s -S -4 https://icanhazip.com
+ curl -s -S -6 https://icanhazip.com
}
# determine local IP address(es)