Backup only directories

2

Currently in our company we have a server linux in which different folders are created daily and we need you to save only the structure of the folders without the information.

    
asked by Erick Preciado 23.06.2017 в 18:52
source

1 answer

3

With a program (convenient option)

You install tree ( apt-get install tree in case it is a system that manages dpkg).

You execute tree -da /home/hamza/directorio-master > tuarchivo.txt , changing /home/hamza/directorio-master for your directory (the one you want to analyze and see what sub-directories it has), you also change tuarchivo.txt for the file in which you want to save the result.

Options:

-d = just list the directories

-a = list the hidden directories (or files)

Result:

Without a program (efficient option)

You execute find /home/hamza/directorio-master type -d > tuarchivo.txt , changing /home/hamza/directorio-master for your directory (the one you want to analyze and see what sub-directories it has), you also change tuarchivo.txt for the file in which you want to save the result.

Options:

-d = just search the directories

Result:

    
answered by 19.07.2017 в 12:34