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}

JP Sugarbroad

Re: and one might think

from: taral
date: Apr. 3rd, 2007 04:50 am (UTC)


Reply | Parent | Thread