Python Forum
a tree command using Shell Script that displays all the directories recursively
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a tree command using Shell Script that displays all the directories recursively
#2
Here's one that's pretty close.

#!/usr/bin/env bash

# bash script to generate tree structure of a directory
# Pravendra Singh : https://pravj.github.io

pwd=$(pwd)
find $pwd -print | sed -e "s;$pwd;\.;g;s;[^/]*\/;|__;g;s;__|; |;g"
Reply


Messages In This Thread
RE: a tree command using Shell Script that displays all the directories recursively - by BashBedlam - Nov-18-2021, 10:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  script wanted: print the command Skaperen 5 4,207 Dec-12-2017, 12:02 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020