I am trying to list all the directories inside another directory and put it onto a file using sed.
Command Used:
ls -ld <directory path>/* | sed 's/^.*\(what.*\).*\//\1/'
What it print onto terminal:
what_111
what_222
When I put it onto a file, this is what I see: Un-visible characters getting put onto file.
what_111^[[0m^[[K
what_222^[[0m^[[K
How do I remove them from sed output while putting onto file ? Any comments would be helpful.