5

How to list only directories names on Linux

view full story
linux-howto

http://www.go2linux.org – This is a small tip, but a useful one also, to list only the directories in Linux use this command. ls -d ./*/ That will have an output like this ./ConsoleKit/ ./bash_completion.d/ ./cron.daily/ ./default/ ./gnome-vfs-2.0/ ./iptables/ ./logrotate.d/ ./nginx/ ./php/ ./profile.d/ ./skel/ ./vbox/ ./ODBCDataSources/ ./bluetooth/ ./cron.hourly/ ./fail2ban/ There are other ways, if you want it in a single column, use this ones: <!--break--> ls -l | awk ' /^d/ {print $9}' You (HowTos)