In which file kernel updates in /proc file system for a paritucalr process id(2145)..i.e. /proc/2145

I came to know that kernel only contacts with the /proc file system which is  a virtual file system. and what are all the processes are running in the system has separate directory in the /proc file system. So in order to know it practically i have run the some of the commands in background as below. But i found that so many files are in the /proc/2145 directory...among them which file can be updated by the kernel ....iam confused...please check below code and advise me please?

bharath-virtual-machine ~ # (sleep 100; cal > /tmp/raju; sleep 100)&
[1] 2145
bharath-virtual-machine ~ # ps -eaf | grep 2145
root      2145  2095  0 10:42 pts/0    00:00:00 -bash
root      2146  2145  0 10:42 pts/0    00:00:00 sleep 100
root      2148  2095  0 10:42 pts/0    00:00:00 grep --colour=auto 2145
bharath-virtual-machine ~ # jobs
[1]+  Running                 ( sleep 100; cal > /tmp/raju; sleep 100 ) &


bharath-virtual-machine ~ # cd /proc
bharath-virtual-machine proc # ls -ld 2???
dr-xr-xr-x 9 root root 0 Sep 14 10:34 2082
dr-xr-xr-x 9 root root 0 Sep 14 10:35 2095
dr-xr-xr-x 9 root root 0 Sep 14 10:42 2143
dr-xr-xr-x 9 root root 0 Sep 14 10:42 2145
dr-xr-xr-x 9 root root 0 Sep 14 10:44 2150
dr-xr-xr-x 9 root root 0 Sep 14 10:44 2151
bharath-virtual-machine proc # cd 2145
bharath-virtual-machine 2145 # ls -lrt
total 0
-r--r--r-- 1 root root 0 Sep 14 10:42 status
-r--r--r-- 1 root root 0 Sep 14 10:42 stat
dr-x------ 2 root root 0 Sep 14 10:42 fd
-r--r--r-- 1 root root 0 Sep 14 10:42 cmdline
-r--r--r-- 1 root root 0 Sep 14 10:45 wchan
dr-xr-xr-x 3 root root 0 Sep 14 10:45 task
-r--r--r-- 1 root root 0 Sep 14 10:45 syscall
-r--r--r-- 1 root root 0 Sep 14 10:45 statm
-r--r--r-- 1 root root 0 Sep 14 10:45 stack
-r--r--r-- 1 root root 0 Sep 14 10:45 smaps
-r--r--r-- 1 root root 0 Sep 14 10:45 schedstat
-rw-r--r-- 1 root root 0 Sep 14 10:45 sched
lrwxrwxrwx 1 root root 0 Sep 14 10:45 root -> /
-r--r--r-- 1 root root 0 Sep 14 10:45 personality
-r--r--r-- 1 root root 0 Sep 14 10:45 pagemap
-r--r--r-- 1 root root 0 Sep 14 10:45 oom_score
-r--r--r-- 1 root root 0 Sep 14 10:45 numa_maps
dr-x--x--x 2 root root 0 Sep 14 10:45 ns
dr-xr-xr-x 5 root root 0 Sep 14 10:45 net
-r-------- 1 root root 0 Sep 14 10:45 mountstats
-r--r--r-- 1 root root 0 Sep 14 10:45 mounts
-r--r--r-- 1 root root 0 Sep 14 10:45 mountinfo
-rw------- 1 root root 0 Sep 14 10:45 mem
-r--r--r-- 1 root root 0 Sep 14 10:45 maps
dr-x------ 2 root root 0 Sep 14 10:45 map_files
-r--r--r-- 1 root root 0 Sep 14 10:45 limits
-r--r--r-- 1 root root 0 Sep 14 10:45 latency
dr-x------ 2 root root 0 Sep 14 10:45 fdinfo
lrwxrwxrwx 1 root root 0 Sep 14 10:45 exe -> /bin/bash
-r-------- 1 root root 0 Sep 14 10:45 environ
lrwxrwxrwx 1 root root 0 Sep 14 10:45 cwd -> /root
-r--r--r-- 1 root root 0 Sep 14 10:45 cpuset
-rw-r--r-- 1 root root 0 Sep 14 10:45 comm
--w------- 1 root root 0 Sep 14 10:45 clear_refs
-r--r--r-- 1 root root 0 Sep 14 10:45 cgroup
-r-------- 1 root root 0 Sep 14 10:45 auxv
-rw-r--r-- 1 root root 0 Sep 14 10:45 autogroup
dr-xr-xr-x 2 root root 0 Sep 14 10:45 attr
-r--r--r-- 1 root root 0 Sep 14 10:45 sessionid
-rw-r--r-- 1 root root 0 Sep 14 10:45 oom_score_adj
-rw-r--r-- 1 root root 0 Sep 14 10:45 oom_adj
-rw-r--r-- 1 root root 0 Sep 14 10:45 loginuid
-r-------- 1 root root 0 Sep 14 10:45 io
-rw-r--r-- 1 root root 0 Sep 14 10:45 coredump_filter

bharath-virtual-machine 2145 # ls -lrt
ls: cannot open directory .: No such process
[1]+  Done                    ( sleep 100; cal > /tmp/raju; sleep 100 )  (wd: ~)
(wd now: /proc/2145)
bharath-virtual-machine 2145 # cd ..
-bash: cd: ..: No such file or directory
bharath-virtual-machine 2145 #
LVL 1
BharathKumarRaju DasaraRajuDevops EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
I do not understand what you are looking for.
2145 was the shell Login there are many things that get set environment variables, resources, etc.
0
BharathKumarRaju DasaraRajuDevops EngineerAuthor Commented:
@arnold...... Thanks for your reply
my question is 2145 is a process id for the command which i was executed in background.......

a directory has been created with the same number as 2145 and the so many files also created there...

after that background command execution completes.....all those files and that directory itself removed....could you please tell me in those files...where the kernel can maintain state of the process execution and task implementation
0
arnoldCommented:
All those references are the state during execution.

Not sure what are you looking for still.  In your example are you looking for a reference that points to in the current situation how many seconds are left?
Look at stat/status.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

BharathKumarRaju DasaraRajuDevops EngineerAuthor Commented:
@arnold...

my clear question how those files created in the /proc/2145 directory and how those are automatically destroyed....is there any kernel intervention there?
0
arnoldCommented:
The kernel is the maintainer of /proc based on commands/calls/etc.
There are many writeups on the /proc file system.
A simple search for "/proc filesystem" will return multitude of discussions depending on the audience. There is the kernel.org reference, linuxjournal.com, etc.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BharathKumarRaju DasaraRajuDevops EngineerAuthor Commented:
Thanks for the information and references as well
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.