Home arrow Journal arrow Display only directories and not files from command line
Display only directories and not files from command line PDF
Thursday, 14 June 2012
If we want to display on FreeBSD's shell only directories using ls command here's how to:

  ls -l | egrep '^d'

You will get something like this:

display only directories and not files
#  ls -l | egrep '^d'
drwxr-xr-x  3 root      wheel        512 Feb 11 20:33 CORBA
drwxr-xr-x  5 root      wheel        512 Mar 10 20:09 ConsoleKit
drwxr-xr-x  2 root      wheel        512 Apr 14 14:38 ImageMagick
drwxr-xr-x  2 root      wheel        512 Mar 10 19:50 PolicyKit
drwxr-xr-x  2 root      wheel        512 Mar 10 20:08 UPower
drwxr-xr-x  5 root      wheel        512 Feb 11 20:33 X11
drwxr-xr-x  5 root      wheel        512 May 17 01:28 apache22
drwxr-xr-x  8 root      wheel       1024 Feb 13 13:07 asciidoc
drwxr-xr-x  3 root      wheel        512 Apr 14 14:45 avahi
drwxr-xr-x  2 root      wheel        512 Mar 10 19:04 bash_completion.d
drwxr-xr-x  2 root      wheel        512 Mar 10 22:33 bonobo-activation
drwxr-xr-x  4 root      wheel        512 Feb 12 20:15 dbus-1
drwxr-xr-x  2 root      wheel        512 Jun 11 14:18 devd
drwxr-xr-x  2 root      wheel        512 Apr 14 15:38 dovecot


 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?