cat /proc/<pid>/environ
If you want to have pid(s) of a given running executable you can, among a number of other possibilities, use pidof
:
AlberT$ pidof sshd
30690 6512
EDIT:
I totally quote Dennis Williamson and Teddy comments to achieve a more readable output.
My solution is the following:
tr '\0' '\n' < /proc/<pid>/environ
Related Posts:
- How to get pid of just started process
- How to sort ps output by process start time?
- How to set the environmental variable LD_LIBRARY_PATH in linux
- How do I grep recursively?
- How do I grep recursively?
- How do I grep recursively?
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- SSH using python script
- How can I exclude directories from grep -R?
- How can I exclude directories from grep -R?
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- How to cat <
> a file containing code? - Extract file basename without path and extension in bash
- Given two directory trees, how can I find out which files differ by content?
- Diff command along with Grep gives “Binary file (standard input) matches”
- How to download a file from server using SSH?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- What does `set -x` do?
- Command to change the default home directory of a user
- Using ls to list directories and their total sizes
- What does “&” at the end of a linux command mean?
- Can’t remove a directory in Unix
- Syntax error near unexpected token ‘then’
- C fopen vs open
- Difference between exec, execvp, execl, execv?
- Restarting cron after changing crontab file?
- How do I write stderr to a file while using “tee” with a pipe?
- cd into directory without having permission
- How to add a default include path for GCC in Linux?
- Copying a large directory tree locally? cp or rsync?
- Can I nohup/screen an already-started process?
- In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?
- When does /tmp get cleared?
- SSL Certificate Location on UNIX/Linux
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- What does ‘set -e’ do, and why might it be considered dangerous?
- Keeping a linux process running after I logout
- Meaning of directories on Unix and Unix like systems
- How to remove empty/blank lines from a file in Unix (including spaces)?
- How to forcibly close a socket in TIME_WAIT?
- How can I rename a Unix user?
- Can you have more than one ~/.ssh/config file?
- How to disable everything in crontab -l?
- Dump a linux process’s memory to file
- Bash: No such file or directory?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- How to unmount a busy device
- How to kill a process running on particular port in Linux?
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- Building HelloWorld C++ Program in Linux with ncurses
- tar removing leading ‘/’ from member names
- Directory Inode vs Regular File Inode
- Opening a .tar.gz file with a single command
- How to make and apply SVN patch?
- connect to host localhost port 22: Connection refused
- Implementing shell in C and need help handling input/output redirection
- Can you Run Xcode in Linux?
- Implementation of multiple pipes in C
- chmod: changing permissions of ‘my_script.sh’: Operation not permitted
- Terminal Multiplexer for Microsoft Windows – Installers for GNU Screen or tmux
- make -j 8 g++: internal compiler error: Killed (program cc1plus)
- How can I use grep to show just filenames on Linux?
- Bash script prints “Command Not Found” on empty lines
- Linux Bash: Move multiple different files into same directory
- how to search for a directory from the terminal in ubuntu
- How to use dos2unix?
- How to configure both webserver and appserver for WordPress CMS?
- How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal
- Communcation with wordrpess and linux server [closed]
- Can scp copy directories recursively?
- What are the functional differences between .profile .bash_profile and .bashrc
- Why does my hostname appear with the address 127.0.1.1 rather than 127.0.0.1 in /etc/hosts?
- Linux command to inspect TXT records of a domain [closed]
- df in linux not showing correct free space after file removal
- Setting the hostname: FQDN or short name?
- How do I sleep for a millisecond in bash or ksh
- What useful things can one add to one’s .bashrc? [closed]
- How to add a timestamp to bash script log?
- How can I kill all stopped jobs?
- How to copy file preserving directory path in Linux?
- Postfix – how to retry delivery of mail in queue?
- Is it possible to alias a hostname in Linux?
- How do I list loaded Linux module parameter values?
- Does getting disconnected from an SSH session kill your programs?
- Tips for Securing a LAMP Server
- What Linux distribution is the Amazon Linux AMI based on?
- What is this IP address: 169.254.169.254?
- Should I install Linux applications in /var or /opt?
- Heartbleed: how to reliably and portably check the OpenSSL version?
- swap partition vs file for performance?
- How can I fully log all bash scripts actions?
- Best way to disable swap in Linux
- Testing UDP port connectivity
- memcache vs memcached?
- zcat/gzcat works in linux, not on osx. general linux/osx compatibility
- How can I zip/compress a symlink?
- What is the debian-sys-maint MySQL user (and more)?
- How to find the physical volume(s) that hold a logical volume in LVM