Last active
September 20, 2019 08:40
-
-
Save 3m3x/a96b2bddba004802f0a0fafd233591a5 to your computer and use it in GitHub Desktop.
Useful commands to run against /proc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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