?

Log in

No account? Create an account

linux 'ls' question

« previous entry | next entry »
Apr. 1st, 2007 | 09:32 am
mood: busybusy

so, let's say I want to see only the directories, not files, in the current directory. only the names, not their contents.

is there an option to 'ls' for that? I can't seem to come up with one.

Bonus: Also, don't show me any of the hidden (beginning with a dot) folders.

This would work, except that I want the output in the normal-looking ls - C style columns:
ls -F | grep /

This is what I came up with (in bash), but there must be a better way:
find -maxdepth 1 -type d -name '[!.]*' -printf '%f ' | xargs ls -d 2>/dev/null

Link | Leave a comment |

Comments {14}

Nathaniel Eliot

(no subject)

from: temujin9
date: Apr. 2nd, 2007 03:09 am (UTC)
Link

Ooop, missed the 'C-style' requirement. chefmonkey got it right.

Reply | Parent | Thread