I know I can do this to get a list of directory names:
find . -type d -maxdepth 1
but the output looks like:
.
./foo
./bar
but with ./ which I don't want. Is there a way to get find to output just the raw names?
I tried sending the list to stat to format it but that just gives me the same result:
find . -type d -maxdepth 1 -print0 | xargs -0 stat -f '%N'
foo bar ...all on one line without the./in front? – Levon Aug 24 '12 at 13:22