- Linux Shell Scripting Cookbook(Third Edition)
- Clif Flynt Sarath Lakshman Shantanu Tushar
- 62字
- 2021-07-09 19:46:36
How to do it...
Directories in the current path can be displayed in the following ways:
- Use ls with -d to print directories:
$ ls -d */
- Use ls -F with grep:
$ ls -F | grep "/$"
- Use ls -l with grep:
$ ls -l | grep "^d"
- Use find to print directories:
$ find . -type d -maxdepth 1 -print