In Linux, I want to find out all Folder/Sub-folder name and redirect to text file
I tried ls -alR > list.txt
, but it gives all files+folders
You can use find
find . -type d > output.txt
or tree
tree -d > output.txt
tree
, If not installed on your system.
If you are using ubuntu
sudo apt-get install tree
If you are using mac os
.
brew install tree