我正在跟着一个名为
pry的红宝石宝石的
screen cast。在8:10,使用了.tree命令,我相信这是一个Unix命令。
它似乎在我的系统上工作:
- [24] pry(main)> .tree
- \Error: there was a problem executing system command: tree
我已经将问题追溯到here,其中pry引用了一个shell命令:
- Pry::CommandSet.new do
- command(/\.(.*)/,"All text following a '.' is forwarded to the shell.",:listing => ".<shell command>") do |cmd|
- if cmd =~ /^cd\s+(.+)/i
- dest = $1
- begin
- Dir.chdir File.expand_path(dest)
- rescue Errno::ENOENT
- output.puts "No such directory: #{dest}"
- end
- else
- if !system(cmd)
- output.puts "Error: there was a problem executing system command: #{cmd}"
- end
- end
- end
从bash的上下文我尝试使用没有运气的命令树:
- projects/sms(apps2)$ tree
- -bash: tree: command not found
- ~/projects/sms(apps2)$ .tree
- -bash: .tree: command not found
这看起来非常有用,我该如何得到这个命令?
使用
homebrew:
酿造安装树
使用macports:
sudo端口安装树
使用the source:
Follow these directions.(注意事项;你应该使用有意义的标志/等)
< rant>所有系统都应该带有树;我用了很多我们可以将目录结构作为文本发布,而不是图片。< / rant>