sorting files based on time

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default sorting files based on time

    Hi,
    I want to sort all the files based on time of modification in unix that is
    if i issue 'ls -l' it should display all the files sorted based on time. i
    do not want to use -t option.

    I need this because, i list the files using browser and running apache
    server. Is it possible ?

    Thanks in Adavance.

    Regards
    Anand


    Anand Agrawal Guest

  2. Similar Questions and Discussions

    1. FLV Loading based of time of day
      I am stuck. I figured out that this site is not a live enviroment, rather using FLVs for certain days of the week - and the office is even all dark...
    2. get record based on date time
      HI Im creating a site that generates leads. When a lead is generated it will select a broker in the list based on certain criteria. The thing i...
    3. Sorting a query based on URL variable
      Well i dont think it's what you looking for but i made this exemple , check if you need somthing more simple i will chwck for you <cfif...
    4. Is director frame-based or time-based ?
      I was wondering if the following is possible: Translate sprite 1 to sprite 2 in exactly 15 seconds. Can I translate that to the exact number of...
    5. scoring/sorting db search results based on score
      looking for code snippets or links to examples of the following; - Have a database with multiple fields that will be searched against (happens to...
  3. #2

    Default Re: sorting files based on time

    Anand Agrawal wrote:
    > Hi, i do not want to use -t option.
    Pardon?!


    Lorinczy Zsigmond Guest

  4. #3

    Default Re: sorting files based on time

    What i meant is, the default setting should be such that if i give 'ls'
    command the
    files are listed based on time and not by name.


    "Lorinczy Zsigmond" <nospam@for.me> wrote in message
    news:3F118C30.3090203@for.me...
    > Anand Agrawal wrote:
    > > Hi, i do not want to use -t option.
    >
    > Pardon?!
    >
    >

    Anand Agrawal Guest

  5. #4

    Default Re: sorting files based on time

    alias lt='ls -lt'

    Anand Agrawal wrote:
    > What i meant is, the default setting should be such that if i give 'ls'
    > command the
    > files are listed based on time and not by name.
    Lorinczy Zsigmond Guest

  6. #5

    Default Re: sorting files based on time

    On Sun, 13 Jul 2003 18:19:05 +0530, Anand Agrawal
    <anand.agrawal@indiatimes.com> wrote:
    > Hi,
    > I want to sort all the files based on time of modification in unix that is
    > if i issue 'ls -l' it should display all the files sorted based on time. i
    > do not want to use -t option.
    >
    > I need this because, i list the files using browser and running apache
    > server. Is it possible ?
    >
    I think what you want is a script that will sort the files by date
    (using ls -t, why not?), and convert the list into html (easily done in
    awk or perl).

    --
    Here I am, fifty-eight, and I still don't know what I want to be when
    I grow up.
    -- Peter Drucker
    Bill Marcum Guest

  7. #6

    Default Re: sorting files based on time

    Hi,
    I think the problem is not clear.

    What i want to achieve is that, when i run http apache server which will
    directly
    list the files ( as i have allowed for directory listing and directory does
    not have index.html file ) so by default all the files in the directory are
    list if i go to that directory using browser.

    By default these files are listed by name, i want to make if default by
    date.

    for example if i go to that directory i get the files as

    Name Last modified Size Description

    ----------------------------------------------------------------------------
    ----

    Parent Directory 02-Jun-2003 16:56 -
    ISCQA_MOM07thJuly.doc 07-Jul-2003 17:18 61k
    ISCQA_MOM12thMAY.doc 21-May-2003 10:25 49k
    ISCQA_MOM14thJuly.doc 14-Jul-2003 18:05 68k
    ISCQA_MOM16thJune.doc 16-Jun-2003 15:38 46k
    ISCQA_MOM19thMAY.doc 21-May-2003 10:25 55k
    ISCQA_MOM23rdJune.doc 23-Jun-2003 17:38 60k


    After i click on Last Modified, the files are shorted based on time.

    Name Last modified Size Description

    ----------------------------------------------------------------------------
    ----

    Parent Directory 02-Jun-2003 16:56 -
    ISCQA_MOM19thMAY.doc 21-May-2003 10:25 55k
    ISCQA_MOM12thMAY.doc 21-May-2003 10:25 49k
    ISCQA_MOM28thMAY.doc 29-May-2003 08:36 52k
    ISCQA_MOM28thApril.doc 29-May-2003 08:37 47k
    ISCQA_MOM2ndJune.doc 02-Jun-2003 17:58 53k


    Regards
    Anand


    "Lorinczy Zsigmond" <nospam@for.me> wrote in message
    news:3F12362E.6020401@for.me...
    > alias lt='ls -lt'
    >
    > Anand Agrawal wrote:
    >
    > > What i meant is, the default setting should be such that if i give 'ls'
    > > command the
    > > files are listed based on time and not by name.
    >



    Anand Agrawal Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139