How to list directories names but not their contents, in *N*X?

8,886

Solution 1

You can try this command:

ls -d A*/

Solution 2

If you need to do it recursively you could use

find . -type d -name A\*
Share:
8,886

Related videos on Youtube

Petruza
Author by

Petruza

General software engineer, golang advocate, also typescript, C, C++, GDScript dev. Interested in emulation, video games, image processing, machine learning, computer vision, natural language processing, web scraping.

Updated on September 18, 2022

Comments

  • Petruza
    Petruza over 1 year

    If I do a simple ls specifying a filename pattern, like ls A*, for directories that match the pattern, it will enter the directory and give the full listing, but how could I get just the listing for ./ and only the names of the directories inside, but not their contents?

  • grenix
    grenix over 2 years