Loading ...
Sorry, an error occurred while loading the content.

Re: ls -l

Expand Messages
  • Cameron Simpson
    ... Godwin s rather opaque response meant that this behaviour is controlled by the locale settings on your computer, which describe language and related
    Message 1 of 6 , Apr 12, 2007
    • 0 Attachment
      On 12Apr2007 14:52, y.nikhileshwar <y.nikhileshwar@...> wrote:
      | if i execute the ls -l command i will get timings in 24:00 format
      | >
      | > i dont want like that i just want in a.m and p.m format
      |
      | plz send the answer in a clear manner,so that i can understand

      Godwin's rather opaque response meant that this behaviour is controlled
      by the "locale" settings on your computer, which describe language and
      related features. Many commands vary their output based on these
      settings.

      The command "man locale" describes the "locale" command, which reports
      your settings. Running it for me says:

      % locale
      LANG=en_US.UTF-8
      LC_CTYPE=C
      LC_NUMERIC="en_US.UTF-8"
      LC_TIME="en_US.UTF-8"
      LC_COLLATE=C
      LC_MONETARY="en_US.UTF-8"
      LC_MESSAGES="en_US.UTF-8"
      LC_PAPER="en_US.UTF-8"
      LC_NAME="en_US.UTF-8"
      LC_ADDRESS="en_US.UTF-8"
      LC_TELEPHONE="en_US.UTF-8"
      LC_MEASUREMENT="en_US.UTF-8"
      LC_IDENTIFICATION="en_US.UTF-8"
      LC_ALL=

      The command "man 7 locale" describes the available shell environment
      variables that affect this. Personally, I only set two of these variables:

      % env|grep ^LC|sort
      LC_COLLATE=C
      LC_CTYPE=C

      which makes most commands sort output the way I historically expect it.

      You can experiment with various things with "ls" like this:

      % LC_TIME=... ls -l some-filename

      replacing "..." with various valid values. See "man 5 locale" for
      more detailed information on these values.

      Finally, "man ls" describes the workings of the "ls" command.
      If you have a GNU system (eg Linux) then there will be a --time-style
      option:

      --time-style=STYLE
      with -l, show times using style STYLE: full-iso, long-iso,
      iso, locale, +FORMAT. FORMAT is interpreted like `date'; if
      FORMAT is FORMAT1<newline>FORMAT2, FORMAT1 applies to non-recent
      files and FORMAT2 to recent files; if STYLE is prefixed with
      `posix-', STYLE takes effect only outside the POSIX locale

      See "man date" for what you can use for the "FORMAT" string.

      Finally, on many Linux systems the command "man 1p ls" will describe the
      POSIX definition for the "ls" command. The information here should apply
      to almost all UNIX systems, whereas plain "man ls" will give you
      particular system's "ls" command, which should be a superset of "man 1p
      ls".

      Cheers,
      --
      Cameron Simpson <cs@...> DoD#743
      http://www.cskk.ezoshosting.com/cs/

      Everything that can be invented has been invented.
      - Charles H. Duell, Commissioner, U.S. Office of Patents, 1899.
    • Godwin Stewart
      ... Hash: SHA1 On Fri, 13 Apr 2007 09:56:41 +1000, Cameron Simpson ... It was opaque for a reason. If the OP has everything served up on a
      Message 2 of 6 , Apr 12, 2007
      • 0 Attachment
        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        On Fri, 13 Apr 2007 09:56:41 +1000, Cameron Simpson <cs@...>
        wrote:

        > Godwin's rather opaque response meant that this behaviour is
        > controlled by the "locale" settings on your computer,

        It was opaque for a reason.

        If the OP has everything served up on a silver platter like you just
        did, s/he won't remember it nearly as well as had s/he had to search
        for the answers hirself.

        People, you're not supposed to expect everyone to do your legwork for
        you.

        - --
        G. Stewart - gstewart@...

        The day Microsoft makes something that doesn't blow up will be the day
        they start making inflatable dolls.
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.4.1 (GNU/Linux)

        iD8DBQFGHyZoK5oiGLo9AcYRAinHAKCBLe86uDM3GUJFWAwOJo5KeZSmlgCgrAYO
        BAlg3vapYPY/LuZPTrNItZA=
        =HTbV
        -----END PGP SIGNATURE-----
      • Cameron Simpson
        ... On my system there are about 6 or 7 locale manual entries; the normal man command does a good job of concealing that. I told him where to find it, what
        Message 3 of 6 , Apr 13, 2007
        • 0 Attachment
          On 13Apr2007 08:42, Godwin Stewart <gstewart@...> wrote:
          | On Fri, 13 Apr 2007 09:56:41 +1000, Cameron Simpson <cs@...>
          | wrote:
          | > Godwin's rather opaque response meant that this behaviour is
          | > controlled by the "locale" settings on your computer,
          |
          | It was opaque for a reason.
          | If the OP has everything served up on a silver platter like you just
          | did, s/he won't remember it nearly as well as had s/he had to search
          | for the answers hirself.

          On my system there are about 6 or 7 "locale" manual entries; the normal man
          command does a good job of concealing that. I told him where to find it, what
          it was for. And not exactly what to use; he can figure that out.

          | People, you're not supposed to expect everyone to do your legwork for
          | you.

          The net is vast. It helps to tell people where to look, not just a
          single keyword.

          I don't mind doing some explaination. You answer was opaque to the point
          of unhelpfulness, in my opinion.
          --
          Cameron Simpson <cs@...> DoD#743
          http://www.cskk.ezoshosting.com/cs/

          You can blip it twice to clear the bore,
          But blip it thrice, and you've sinned once more.
          - Tom Warner <tom@...>
        Your message has been successfully submitted and would be delivered to recipients shortly.