How could I list sub-directories with ls, with '-d' only the current directory is shown. I want something like find . -type d -maxdepth 1
would give me.
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Invoking Mirth Connect CLI with Powershell script
- Error building gcc 4.8.3 from source: libstdc++.so
This should help:
ls -d */
*/
will only match directories under the current dir. The output directory names will probably contain the trailing '/' though.ls -d */
andls -d */*/
seem to work just fine.You can combine with grep:
To get just the filenames:
You can make this into a handy alias: