Re: ls lacking a feature?



Bernard Liang <b_liang@xxxxxxxxxxxx> wrote:
Well,

ls -l | grep ^d | tr -s ' ' | cut -d' ' -f9

seems to do the trick for me, but this is a very cheap hack, and is
dependent on what fields ls decides to print. I am definitely not
convinced this is the best method, but unfortunately this is the
simplest one I know that works.

-BL

Richard Heathfield wrote:

Bernard Liang said:

how does one perform the equivalent MS-DOS's "dir /a:d" (directory
listing) in *ix (say, linux)?

I use:

ls -al | grep ^d

but there's probably an easier way. :-)

From my .bashrc :

alias lsd='ls -F | grep / | tr -d /'
alias lsx='ls -F | grep "*" | tr -d "*"'
alias lsl='ls -F | grep @ | tr -d @'

Yes, ls is lacking several features. The one I need the most is the
ability to choose exactly what information to display and in what
order. For example ls --date --owner, instead of ls -l piped into cut,
etc.


(Going off topic to the recent thread in comp.lang.c about
verification tools. I keep reading the subject line as "is lacking a
feature")

Roberto Waltman
.



Relevant Pages

  • Re: ls lacking a feature?
    ... seems to do the trick for me, but this is a very cheap hack, and is dependent on what fields ls decides to print. ... ls -al | grep ^d ...
    (comp.programming)
  • Re: tip50 Accepted
    ... exposing more of the magic as pluggable APIs, ... But everything is dependent on finding both time and ... understanding, and I welcome help. ... but having these new features would be very ...
    (comp.lang.tcl)
  • Re: HTML Help control
    ... but your project is just too dependent on ... > The program has a lot of features which use other files, ... make that "Rich" Textbox. ... MS Internet controls can ...
    (microsoft.public.vb.controls)
  • Re: Howto implement catalog feature dependency?
    ... Almost all drivers need device manager, so to add device manager with your ... with your dependent entries. ... > dependent BSP features or just native CE features? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: LabView als Demo oder Lightversion
    ... Der Trick: Word so einstellen, dass keine Features nach der 97er Version benutzt werden. ...
    (de.sci.electronics)