简体   繁体   English

为Linux树命令设置默认级别选项

[英]Set Default Level option for Linux tree command

Is there any way to set a default -L option when running the tree command? 运行tree命令时,有什么方法可以设置默认的-L选项? For example, instead for typing 例如,代替键入

tree -L 2

I would rather type just 我宁愿只是

tree

Currently the default "tree" command shows all nested levels, but I typically want to see only 2 levels deep. 当前,默认的“ tree”命令显示所有嵌套级别,但是我通常只想看到2个级别。 I would still want the option to override the default if I wanted to see something other than 2 levels deep, ie 如果我想看到除2级以外的其他内容,我仍然希望该选项覆盖默认值,即

tree -L 3

根据上面的Biffen,添加别名即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM