Skip to content

Commit

Permalink
Suggest "sudo lsof" rather than just "lsof"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
walles committed Jun 23, 2017
1 parent 4c30277 commit de519fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions px/px_processinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand Down

0 comments on commit de519fb

Please sign in to comment.