
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
This library provides a Ruby implementation of the pstree
utility, enabling
developers to visualize process hierarchies as tree structures. It parses
system process information and presents it in an easily readable format with
proper indentation and Unicode/ASCII tree characters.
The library can be used both programmatically as a data structure and through its command-line interface for quick process tree visualization.
Install the latest version from RubyGems.org:
gem install pstree
Add to your Gemfile:
gem 'pstree'
Then run:
bundle install
/bin/ps
utility available in PATHYou can display a simple process tree by executing the ruby-pstree script.
$ ruby-pstree $$
34223 -bash (flori)
└─ 37124 ruby /Users/flori/.rvm/gems/ruby-2.6.2/bin/ruby-pstree 34223 (flori)
└─ 37129 /bin/ps axww -o ppid,pid,user,command (root)
Access process information programmatically:
require 'pstree'
# Create a process tree for PID 1 (init)
tree = PSTree.new(1)
# Iterate over processes in the tree
tree.each do |process|
puts "#{process.pid}: #{process.cmd}"
end
# Or get the tree as a string
puts tree.to_s
# Navigate the tree to find the pids of your favourite processes
pid_of_shell_parent_of_irb = tree.find { it.cmd =~ /irb/ }&.ppid
The homepage of this library is located at
FAQs
Unknown package
We found that pstree demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.