Skip to content

Instantly share code, notes, and snippets.

@todashuta
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save todashuta/e8d3e690cbdde2de3ce7 to your computer and use it in GitHub Desktop.

Select an option

Save todashuta/e8d3e690cbdde2de3ce7 to your computer and use it in GitHub Desktop.
コマンド名に'_'か'-'が含まれるコマンドを列挙するワンライナー
$ ruby -e 'ENV["PATH"].split(":").map{|path| Dir["#{path}/*"]}.flatten.map{|path| File.basename(path)}.select{|str| str.include?("-") || str.include?("_")}.sort.each{|it| puts it}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment