Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nicdoye
Created October 3, 2015 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicdoye/b928419054300f4131a1 to your computer and use it in GitHub Desktop.
Save nicdoye/b928419054300f4131a1 to your computer and use it in GitHub Desktop.
Find all .pm files (in /usr/*/perl5)
#!/bin/bash
# I know it's a bit stupid and there's better ways to do it. But who doesn't like playing.
# Written for an old CentOS 4 server where people have installed Perl modules any old how.
# Is there a way to merge the two matches together?
find /usr/*/perl5 | ruby -ne '/^(\/\w+){4}\/.*\.pm/.match($_) && puts( /^(\/\w+){4}\/[\.\d]*\/{0,1}(.*)/.match($_)[2] )'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment