Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sysmon
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash
#@Author Shahriar Shovon
#vers. 1.1 Maurizio Bruccoleri (2021-11-03) - resolved issue related to truncated command field value
#@Github https://github.com/shovon8/sysmon
#
printf "%-10s%-15s%-15s%s\n" "PID" "OWNER" "MEMORY" "COMMAND"

function sysmon_main() {
RAWIN=$(ps -o pid,user,%mem,command ax | grep -v PID | awk '/[0-9]*/{print $1 ":" $2 ":" $4}')
local IFS=$'\n'
RAWIN=$(ps -o pid,user,%mem,command ax | grep -v PID | awk '{printf $1":"$2":"}{for(i=4;i<=NF;++i)printf $i""FS ; print ""}')

for i in $RAWIN
do
Expand Down