Skip to content

Instantly share code, notes, and snippets.

@zipizap
Created October 11, 2013 14:20
Show Gist options
  • Save zipizap/6935417 to your computer and use it in GitHub Desktop.
Save zipizap/6935417 to your computer and use it in GitHub Desktop.
zipizap@lnxp:/tmp/depth0$ tree --charset ascii
.
|-- A_depth1
| `-- A_depth2
| `-- A_depth3
|-- B_depth1
| `-- B_depth2
| `-- B_depth3
`-- C_depth1
`-- C_depth2
`-- C_depth3
9 directories, 0 files
# find --maxdepth <0=no-subdirs,1,2,...>
zipizap@lnxp:/tmp/depth0$ find . -maxdepth 0
.
zipizap@lnxp:/tmp/depth0$ find . -maxdepth 1
.
./A_depth1
./C_depth1
./B_depth1
zipizap@lnxp:/tmp/depth0$ find . -maxdepth 2
.
./A_depth1
./A_depth1/A_depth2
./C_depth1
./C_depth1/C_depth2
./B_depth1
./B_depth1/B_depth2
zipizap@lnxp:/tmp/depth0$ find . -maxdepth 3
.
./A_depth1
./A_depth1/A_depth2
./A_depth1/A_depth2/A_depth3
./C_depth1
./C_depth1/C_depth2
./C_depth1/C_depth2/C_depth3
./B_depth1
./B_depth1/B_depth2
./B_depth1/B_depth2/B_depth3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment