All files and directories in /proc that do not contain numbers (in other words, excluding process directories):
ls -d /proc/[^0-9]*
All files are recursively located under /proc , which do not start with a number:
find /proc -regex '.*/[0-9].*' -prune -o -print
But it also excludes numerical files in subdirectories (e.g. /proc/foo/bar/123 ). If you want to exclude only top-level files with a number:
find /proc -regex '/proc/[0-9].*' -prune -o -print
Hold on again! Does this not mean that any regular files created by touch /proc/123 or the like will be excluded? Theoretically, yes, but I donβt think you can do it. Try creating a file for a PID that does not exist:
$ sudo touch /proc/123 touch: cannot touch `/proc/123': No such file or directory
l0b0
source share