ls -options

Discussion in 'OT Technology' started by rumperpumper, Mar 17, 2008.

  1. rumperpumper

    rumperpumper New Member

    Joined:
    Mar 12, 2002
    Messages:
    2,342
    Likes Received:
    0
    Location:
    Brisbane, QLD, Australia
    Is there any option of removing the permissions from the out put of "ls -lrt"

    All i want to display is file/dir in ascending modified order with DTS.

    So far i have figured out "ls -lrtgo" to remove group and owner and to order output in ascending order.

    Cheers fellas
     
  2. JayC71

    JayC71 Guest

    man ls ???
     
  3. crontab

    crontab (uid = 0)

    Joined:
    Nov 14, 2000
    Messages:
    23,458
    Likes Received:
    12
    are there spaced directores/file names in that dir? if not.

    ls -ltr | awk '{print $6" "$7" "$8}'

    if so. dunno.
     
  4. rumperpumper

    rumperpumper New Member

    Joined:
    Mar 12, 2002
    Messages:
    2,342
    Likes Received:
    0
    Location:
    Brisbane, QLD, Australia
    Yeah i tried some thing like that but it didnt like the white spaces...

    I have gone with this...

    test -z ${FILTER} && ls ${DIST_DIR} || (pushd ${DIST_DIR}; for f in `ls` ; do stat -c"%y %n" $f ; done | grep ${FILTER};popd)

    Works ok... not great as has nano seconds too... but it will do for what i need.

    Cheers guys! :bigthumb:
     

Share This Page