10Mar/100
List only directories on the command-line or in your scripts
Here you have some different ways of showing only the directories on a path you specify.
This can be used in different other languages such as PHP with shell_exec for example.
ls -l /shares/ | grep "^d" | awk '{ print $9 }' find /shares/ -maxdepth 1 -mindepth 1 -type d | sed 's/.\///g' find /shares/ -maxdepth 1 -mindepth 1 -type d | perl -pi -e 's/.\///g' find /shares/ -maxdepth 1 -mindepth 1 -type d | grep -v '^\./\.'
I hope you find them useful on some way ![]()
Of course comments are more than welcome!



