# change ps command



## mind_hunt3r (Mar 15, 2013)

*H*i,

I added a variable to every process, then I want to change the ps(1) command and add a column to it to show each process's new variable. What changes should be done now?


----------



## fonz (Mar 15, 2013)

mind_hunt3r said:
			
		

> I added a variable to every process,


Please be a bit more precise. Did you edit the kernel source to add information to PCBs (process control blocks) or something?



			
				mind_hunt3r said:
			
		

> then I want to change the ps(1) command and add a column to it to show each process's new variable.


If you are skilled enough to do what I think you did, you should also be skilled enough to patch the source code of ps(1) to do what you want. Perhaps if you can describe in more detail what it is you did, we can provide more detailed help.


----------



## mind_hunt3r (Mar 15, 2013)

*I* added 
	
	



```
char* mrn_string
```
 to proc.h but now *I* don't know what should be changed for PS to show this mrn_string in a new column of the ps command because *I*'m a beginner in freeBSD FreeBSD and need a little more explanation.


----------



## cpm@ (Mar 16, 2013)

You need adding to ps(1) a 'new' keyword by modifying keyword.c, ps.1 and ps.c files located in source code /usr/src/bin/ps/ directory.


----------

