I know globale linux shell has set of environment variables. And when an application is running it has own set of variables. But how to access them or access their shell. There are ways in some apps. Ex: It can be accessed to snap packages shell with snap run --shell app_name
. But if I need to access application like gedit how to do it?
Asked
Active
Viewed 214 times
1

Lakindu Akash
- 1,421
1 Answers
0
As already answered on comments by our friends
sudo cat /proc/$(pgrep gedit)/environ | tr '\0' '\n'
References:
But it is not worth much as all classic GUI app run same environment accept when user customize a desktop launcher or script and modified it. Which is not the case with snaps.

user.dz
- 48,105
/etc/$pid/environ
– PerlDuck May 01 '18 at 10:31pgrep gedit
and then see How do I split a “/proc/*/environ” file in separate lines? – steeldriver May 01 '18 at 12:00sudo cat /proc/$(pgrep gedit)/environ | tr '\0' '\n'
? – Cyrus May 01 '18 at 16:21