1.ls-d *
Copy Code code as follows:
amosli@amosli-pc:~$ ls-d *
%appdata% Develop many Sorted.txt workspace
Bank Documents Music Space Download
2. Find.-type d-maxdepth 1
If you do not add-maxdepth parameters, then there will be an infinite number of directories are listed.
Copy Code code as follows:
amosli@amosli-pc:~$ find. -type d-maxdepth 1
./videos
./public
./%appdata%
./.kde
./.gnome2
./music
3.ls-f | grep '/$ '
Using the Linux piping command, grep looks for the '/$ '/end, which is also the directory
Copy Code code as follows:
amosli@amosli-pc:~$ Ls-f | grep '/$ '
%appdata%/
bank/
desktop/
develop/
documents/
4.ls-l | grep ' ^d '
Copy Code code as follows:
amosli@amosli-pc:~$ Ls-l | grep ' ^d '
Drwxr-xr-x 3 Amosli amosli 4096 June 2013%appdata%
Drwxr-xr-x Amosli amosli 4096 December 17:44 Bank
Drwxr-xr-x 4 Amosli amosli 4096 December 00:33 Desktop
Drwxrwxr-x Amosli amosli 4096 December 19:11 Develop
Drwxr-xr-x 3 Amosli amosli 4096 July 9 00:58 Documents