Skip to content

Instantly share code, notes, and snippets.

@3m3x
Last active September 20, 2019 08:40
Show Gist options
  • Save 3m3x/a96b2bddba004802f0a0fafd233591a5 to your computer and use it in GitHub Desktop.
Save 3m3x/a96b2bddba004802f0a0fafd233591a5 to your computer and use it in GitHub Desktop.
Useful commands to run against /proc
# Obtain the (IPv4) addresses for all network interfaces
awk '/32 host/ { print f } {f=$2}' <<< "$(</proc/net/fib_trie)"
# Get info about the CPU
cat /proc/cpuinfo
# List the available filesystems
cat /proc/filesystems
# See what filesystems are mounted
cat /proc/mounts
# See the environment variables a process has access to
cat /proc/$SOME_PROCESS_ID/environ
# See the command line arguments that were used to launch a program
cat /proc/$SOME_PROCESS_ID/cmdline
# See memory info for process
#
# Columns:
# 1. virtual memory addresses used
# 2. permissions for address access
# 3. offset into the mapping
# 4. device storing this file
# 5. inode on the device for this address space
# 6. pathname to the file associated with this address space
#
cat /proc/$SOME_PROCESS_ID/maps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment