From de519fb7fe23e19df877ff2c978e9e542903e08e Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Fri, 23 Jun 2017 07:23:11 +0200 Subject: [PATCH] Suggest "sudo lsof" rather than just "lsof" When invoking px on a single PID, suggest using "sudo lsof" rather than just "lsof" to get the full list of file descriptors for a process. I sometimes copy / paste these suggestions, and a lot of times when I do that I have to add "sudo" manually to get it working. --- README.rst | 2 +- px/px_processinfo.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 8cd5fad..8331e10 100644 --- a/README.rst +++ b/README.rst @@ -130,7 +130,7 @@ This shows detailed info about PID 80727. mDNSResponder(201) [unix] ->0xe32cbd7be6021f1f - For a list of all open files, do "lsof -p 80727", or "watch lsof -p 80727" for a live view. + For a list of all open files, do "sudo lsof -p 80727", or "sudo watch lsof -p 80727" for a live view. * The command line has been split with one argument per line. This makes long command lines readable. diff --git a/px/px_processinfo.py b/px/px_processinfo.py index a8e0a07..0ed5c9d 100644 --- a/px/px_processinfo.py +++ b/px/px_processinfo.py @@ -174,8 +174,8 @@ def print_fds(process, processes): print(" " + channel_name) print("") - print("For a list of all open files, do \"lsof -p {0}\", " - "or \"watch lsof -p {0}\" for a live view.".format(process.pid)) + print("For a list of all open files, do \"sudo lsof -p {0}\", " + "or \"sudo watch lsof -p {0}\" for a live view.".format(process.pid)) if os.getuid() != 0: print("")