首先需要安装tree这个软件 sudo apt install tree tree -L 2 target_dir/ 2代表列举的目录结构深度 转载于:https://www.cnblogs.com/clemente/p/10723582.html