Created
June 1, 2015 18:31
-
-
Save jamesrr39/ab80b0fd175daa6c6d51 to your computer and use it in GitHub Desktop.
Get working directory of a searched for process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get the working directory of processes | |
search_term="$1" | |
pgrep "$search_term" | xargs -I {} readlink -f /proc/{}/cwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment