Skip to content

sbravo15/useful-shell-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Useful Shell Scripts

A collection of useful shell scripts for various tasks.

Table of Contents

  1. Generate File Structure
  2. Adding More Scripts
  3. Contribution

Generate File Structure

This script maps and prints the file structure of a given directory into a text file. It simplifies the process of analyzing the directory structure for testing or documentation purposes.

View Script

Usage

To use the generate_file_structure.sh script, follow these steps:

  1. Navigate to the Directory: Open your terminal and navigate to the directory you want to map and make a .txt with the script - View Script inside of this directory where the generate_file_structure.sh script is located. For example:

    cd path/to/your/repository

  1. Make the Script Executable: Ensure the script has execute permissions with the following command:

    chmod +x generate_file_structure.sh

    Make the Script Executable


  1. Run the Script: Use the following command to execute the script, replacing <directory> with the path to the directory you want to analyze or using . to reference your current directory:

    ~ generate_file_structure.sh <directory>

    Run the Script


  1. Confirm File Creation: After the script completes, check that the file_structure.txt file has been created successfully in your directory.

    File Created


  1. View the Output: After running the script, it will create a file named file_structure.txt in the current directory. This file contains the hierarchical structure of the specified directory.

    Output Example


  1. Check the Debug Log: The script also generates a debug.log file, which logs each directory and file processed during execution. This can be helpful for troubleshooting.

Example

In the example above, we used the cookiecutter-flask repository to demonstrate how to generate a text file containing the file structure. We recommend using your preferred visual editor to view the .txt file and examine the file structure.

We hope this script proves useful for debugging, documentation, and any other creative applications you can think of.

About

A collection of useful shell scripts for various tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages