1

When I list /proc/<PID>, works as expected. But when I use ps or ls /proc | grep <PID>, the process is hidden. How & Why is this possible?

[user@host ~]$ ls /proc/12263
attr             cpuset   limits      net            projid_map  statm
autogroup        cwd      loginuid    ns             root        status
auxv             environ  map_files   numa_maps      sched       syscall
cgroup           exe      maps        oom_adj        sessionid   task
clear_refs       fd       mem         oom_score      setgroups   timers
cmdline          fdinfo   mountinfo   oom_score_adj  smaps       uid_map
comm             gid_map  mounts      pagemap        stack       wchan
coredump_filter  io       mountstats  personality    stat
[user@host ~]$ ls /proc | grep 122
12230
12231
12260
12297
[user@host ~]$ ls /proc/12263
attr             cpuset   limits      net            projid_map  statm
autogroup        cwd      loginuid    ns             root        status
auxv             environ  map_files   numa_maps      sched       syscall
cgroup           exe      maps        oom_adj        sessionid   task
clear_refs       fd       mem         oom_score      setgroups   timers
cmdline          fdinfo   mountinfo   oom_score_adj  smaps       uid_map
comm             gid_map  mounts      pagemap        stack       wchan
coredump_filter  io       mountstats  personality    stat
[user@host ~]$ ls /proc | grep 122
12230
12231
12260
12297
[user@host ~]$ ps -fp 12263
UID        PID  PPID  C STIME TTY          TIME CMD
[user@host ~]$ 
balki
  • 4,407

0 Answers0