Skip to content

Instantly share code, notes, and snippets.

@rindeal
Last active April 19, 2024 10:35
Show Gist options
  • Save rindeal/65cd940f7a33c9c8e49018adb673fe0e to your computer and use it in GitHub Desktop.
Save rindeal/65cd940f7a33c9c8e49018adb673fe0e to your computer and use it in GitHub Desktop.
Linux file IO monitoring sysdig read/write/open files
# per process stats
awk -F\| '{a[$1]++}END{for(p in a)printf "%-20s | %d\n",p,a[p]}' io.log | sort -t\| -nk2
#!/bin/sh
sudo sysdig -p '%proc.name|%evt.arg.fd.name' \
'evt.dir=> and ( fd.type=file or fd.type=directory ) and fd.name!=""' | \
awk -F\| '
BEGIN{
OFS="|"
}
$2!~/^<f>\/(dev|proc|run|sys).*/ {
print $1,substr($2,4);
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment