2014年4月3日 星期四

Linux ls directory only

ls -l | grep ^d

ls -d */

Where -d says “do not descend into sub-directories, it is the same as saying -d1.
The */ says list only items ending in / (which are directories).
If you want to see hidden directories, you could do a ls -d .*/


find . -type d -maxdepth 1 -mindepth 1


tree -d -L 1

http://embraceubuntu.com/2005/10/19/list-only-the-directories/

沒有留言:

張貼留言