ls
コマンド
ls -F [パス] | grep /
隠しファイルも含めて表示
ls -aF [パス] | grep /
サンプル
$ ls -F path/to/sample | grep /
app/
bin/
config/
db/
lib/
log/
public/
spec/
storage/
templates/
test/
tmp/
vendor/
$ ls -aF path/to/sample | grep /
./
../
.devcontainer/
.docker/
.git/
.vscode/
app/
bin/
config/
db/
lib/
log/
public/
spec/
storage/
templates/
test/
tmp/
vendor/
または次のように実行します。
$ ls -lR ./ | grep ^d
drwxr-xr-x 2 root root 44 12月 6 20:48 dir1
drwxr-xr-x 2 root root 44 12月 6 21:33 dir2
drwxr-xr-x 2 root root 6 12月 6 21:36 dir1-1
drwxr-xr-x 2 root root 6 12月 6 21:36 dir1-2
drwxr-xr-x 2 root root 6 12月 6 21:36 dir2-1
drwxr-xr-x 2 root root 6 12月 6 21:36 dir2-2
find
コマンド
find
コマンドでディレクトリのみの一覧を取得するには次のように実行します。
$ find ./ -mindepth 1 -type d
./app
./bin
./config
./db
./lib
./log
./public
./spec
./storage
./templates
./test
./tmp
./vendor