zoukankan      html  css  js  c++  java
  • 【Linux】tree 的妙用

    最近看到一个写的非常漂亮的 README,操作步骤和目录结构都列的非常清楚。心想这种目录结构看着像通过某种工具做出来的,于是搜索了下“自动生成 README”,还真查到了 tree,一个在 Linux 和 Windows 上都可以用的命令。

    tree 的作用是以结构化的方式列出文件夹的目录结构,比如说在一个 a 文件夹下,有 b1 和 b2 文件夹以及 c 文件,在 b1 和 b2 文件夹下有 c1 和 C2 文件。在 a 目录下敲击 tree,即可列出如下目录结构:

    .
    |-- b1
    |   |-- c1
    |   `-- c2
    |-- b2
    |   |-- c1
    |   `-- c2
    `-- c
    

    怎样?非常的清楚吧!以后写 README 的时候,就可以使用这个命令列出好看的目录结构,除了语句说明操作步骤外,其他的详细说明就可以写在目录结构的名字旁,比如:

    .(this is root dir)
    |-- b1(this is b1)
    |   |-- c1(c1 refer to the champion1)
    |   `-- c2(c2 refer to the champion2)
    |-- b2(this is b2)
    |   |-- c1
    |   `-- c2
    `-- c
    
  • 相关阅读:
    Reverse Linked List
    Sqrt(x)
    Convert Sorted Array to Binary Search Tree
    Remove Linked List Elements
    Happy Number
    Length of Last Word
    Pow(x, n)
    Rotate Image
    Permutations
    Integer to Roman
  • 原文地址:https://www.cnblogs.com/liushengchieh/p/12780176.html
Copyright © 2011-2022 走看看