Reputation: 825
I need a shell script that writes the tree structure (including all data in the folders) from a specific folder to a text/dat file.
So far I got this:
find . -type f|sed 's_\.\/__' > PATH/Input.dat
I dont want a "/" as the first char of the path.
This script works fine, but it returns ALL folder structures. I need something that returns only structures from a specific folder, like "Sales".
Upvotes: 1
Views: 965
Reputation: 123518
I need something that returns only structures from a specific folder, like "Sales".
Specify the desired folder name. Say:
find Sales -type f | sed 's_\.\/__'
^^^^^
Saying find . ...
would search in .
(i.e. the current directory and subdirectories).
If you need to search more folders, say Purchase
, specify those too:
find Sales Purchase -type f | sed 's_\.\/__'
Upvotes: 2