Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing modification for OS X Terminal #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ralphjesy12
Copy link

Resolving issues with top and free commands on OS X:

invalid option or syntax: -bn1
top usage: top
...
command not found: free
...
awk: weird printf conversion %
 input record number 2, file 
 source line number 1
awk: not enough args in printf(☉ Disk Usage: %.1f%)
 input record number 2, file 
 source line number 1

@mdelahais
Copy link

I m work in Maverick and it's works

capture d ecran 2017-09-03 a 19 17 37

igeek zsh-theme

System load

g_load=top -l 1 | grep "usage" | awk '{print "☉ System load " $1,":",$3}'

Memory Usage

g_memory=top -l 1 | awk '/PhysMem/ {print "☉ Memory Usage: ", $6}'

Disk Usage

g_disk=df -h | awk '$NF=="/"{print "☉ Disk Usage:", $5}'

System uptime

g_uptime=uptime | awk -F'( |,|:)+' '{ if ($7=="min") m=$6; else { if ($7~/^day/) { d=$6; h=$8; m=$9} else {h=$6;m=$7}}}{print "☉ System uptime:",d+0,"days,",h+0,"hours"}'

Repository owner deleted a comment Feb 2, 2024
Repository owner deleted a comment Feb 5, 2024
Repository owner deleted a comment from muriloferes Feb 5, 2024
Repository owner deleted a comment Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants