pssearch - v. 1.3
ps looking for a process isn’t that pleasure.
Of course we can grep, but it’s still hard to read values without headings, and determine launch hierarchy.
On some linux distros there is the
pstree command, I tried to do something similar for this
This utility is also useful to determine which process is using a file or a folder, e.g. preventing its deletion.
pssearch requires one argument:
- When the argument is a path to an existing file or folder then will be reported the process (if any) that is using the file or the folder.
- When the argument only contains numbers it’s assumed to be a PID number.
case-insensitive-part-of-commandis used inside a regex case insensitive match, it can actually be a simple regex - e.g.: “
Therefore if you want to use verbatim for special characters (like
.+*?()$\) prexif them with double backslash - e.g.:
+ => \\+, \ => \\\\
pssearchaccepts one and only one argument.
Should such argument contain whitespaces, wrap it with quotes or quote whitespaces with
pssearch "google chrome",
pssearch google\ chrome
This utility isn’t limited to Mac, it can be used on wathever *nix operating system with
perl (roughly whatever *nix).
fusercommand, if available, is used to convert the full path of a file into the PID of the process that is using it.
Cwdmodule if used to convert local path to absolute paths for
If the module is missing you can still use absolute paths.
Download the attached script, unzip it.
cd to the expanded folder, and:
sudo cp -p pssearch /usr/local/bin