Triple Entendre (triple_entendre) wrote,
Triple Entendre

  • Mood:

linux 'ls' question

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

Tags: command-line, linux
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.