$ ls -d */
Desktop/ pic/ shell/ src/
$ ls -F |grep "/$"
Desktop/
pic/
shell/
src/
# ls -l |grep "^d"
drwxr-xr-x 2 root root 4096 2011-05-08 01:46 Desktop
drwxr-xr-x 2 root root 4096 2012-03-26 10:03 pic
drwxr-xr-x 2 root root 4096 2012-03-30 17:21 shell
drwxr-xr-x 3 root root 4096 2012-03-22 22:18 src
ls -l |grep "^d" |awk '{print $8}'
Desktop
pic
shell
src
root@bt:~# find . -maxdepth 1 -type d
.
./.kde
./.pulse
./.xine
./shell
./.vim
./.debtags
./.ssh
./pic
./.dbus
./.aptitude
./.subversion
./.wine
./.cache
./.gem
./.local
./.config
./Desktop
./src
./.mozilla
root@bt:~# find . -maxdepth 1 -type d |grep -E -v "\./\..*"
.
./shell
./pic
./Desktop
./src
root@bt:~# find . -maxdepth 1 -type d |grep -E -v "\./[.].*" | sed '1d'
./shell
./pic
./Desktop
./src
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |