我需要帮助脚本显示当前目录的子目录结构,以及这些子目录中的文件名。
我试过命令tree、ls和grep,但是很难找到我需要的确切命令(S)。
发布于 2014-05-18 23:49:09
安装tree包:
sudo apt-get install tree指挥:
$ tree -l "l“选项:
-l Follows symbolic links if they point to directories, as if they
were directories. Symbolic links that will result in recursion
are avoided when detected.产出:
.
├── 1
│ ├── 1.png
│ └── Untitled Document
├── 10271474_10154132320890137_6530350599362308925_n.jpg
└── f
├── a.html
├── b.html
└── d.css
2 directories, 6 files我有两个目录:
1 and f and a jpg file in ~/Desktop and list file in 1 and f发布于 2014-05-18 23:48:33
显示目录结构(即仅显示目录):find . -type d
显示混合在一起的所有内容:find .
要用更多的细节来显示所有内容,您可以知道什么是文件,什么是目录:find . -ls
https://askubuntu.com/questions/468845
复制相似问题