Why ls -lrth and ls -ltch gives different results

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I was trying to find the time of database backup. Normally i use




ls -ltch



But this time i used




ls -lrth



It gave me different result for One file and all date-stamps were same for both commands



-rw-r----- 1 oracle dba 41M Dec 7 23:59 ctrl_071223
-rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
-rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
-rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
-rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
-rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
-rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
-rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
[root@pdbosl02 daily]# ls -lrth
total 12G
-rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
-rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
-rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
-rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
-rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
-rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
-rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
-rw-r----- 1 oracle dba 41M Dec 7 20:52 ctrl_071223


What I'm missing










share|improve this question



























    up vote
    1
    down vote

    favorite












    I was trying to find the time of database backup. Normally i use




    ls -ltch



    But this time i used




    ls -lrth



    It gave me different result for One file and all date-stamps were same for both commands



    -rw-r----- 1 oracle dba 41M Dec 7 23:59 ctrl_071223
    -rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
    -rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
    -rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
    -rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
    -rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
    -rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
    -rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
    [root@pdbosl02 daily]# ls -lrth
    total 12G
    -rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
    -rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
    -rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
    -rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
    -rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
    -rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
    -rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
    -rw-r----- 1 oracle dba 41M Dec 7 20:52 ctrl_071223


    What I'm missing










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I was trying to find the time of database backup. Normally i use




      ls -ltch



      But this time i used




      ls -lrth



      It gave me different result for One file and all date-stamps were same for both commands



      -rw-r----- 1 oracle dba 41M Dec 7 23:59 ctrl_071223
      -rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
      -rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
      -rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
      -rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
      -rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
      -rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
      -rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
      [root@pdbosl02 daily]# ls -lrth
      total 12G
      -rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
      -rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
      -rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
      -rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
      -rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
      -rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
      -rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
      -rw-r----- 1 oracle dba 41M Dec 7 20:52 ctrl_071223


      What I'm missing










      share|improve this question















      I was trying to find the time of database backup. Normally i use




      ls -ltch



      But this time i used




      ls -lrth



      It gave me different result for One file and all date-stamps were same for both commands



      -rw-r----- 1 oracle dba 41M Dec 7 23:59 ctrl_071223
      -rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
      -rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
      -rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
      -rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
      -rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
      -rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
      -rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
      [root@pdbosl02 daily]# ls -lrth
      total 12G
      -rw-r----- 1 oracle dba 3.8G Dec 7 20:43 BKPOSLPRD_jcns9p1f.F_bkp
      -rw-r----- 1 oracle dba 4.2G Dec 7 20:46 BKPOSLPRD_jdns9p1f.F_bkp
      -rw-r----- 1 oracle dba 3.0G Dec 7 20:51 BKPOSLPRD_jbns9p1f.F_bkp
      -rw-r----- 1 oracle dba 140M Dec 7 20:52 ALG_OSLPRD_jgns9rfr.alg
      -rw-r----- 1 oracle dba 189M Dec 7 20:52 ALG_OSLPRD_jfns9rfr.alg
      -rw-r----- 1 oracle dba 202M Dec 7 20:52 ALG_OSLPRD_jens9rfr.alg
      -rw-r----- 1 oracle dba 42M Dec 7 20:52 c-4249173797-20121207-00
      -rw-r----- 1 oracle dba 41M Dec 7 20:52 ctrl_071223


      What I'm missing







      ls timestamps






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 8 '12 at 23:35









      Gilles

      512k12010151547




      512k12010151547










      asked Dec 8 '12 at 14:19









      OmiPenguin

      1,485235784




      1,485235784




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          The differences between both commands are:



          • the 2nd listing is sorted in reverse (-r)

          • the 2nd listing uses the modification time stamp as sort key (-t)

          • the 1st listing uses the ctime stamp as sort key (-tc)

          On UNIX a file has 3 time stamps (atime, ctime, mtime) which are updated under different conditions.



          To quote the wikipedia article on stat:




          atime: time of last access (ls -lu),
          mtime: time of last modification (ls -l), and
          ctime: time of last status change (ls -lc).




          An example for a status change is changing the permissions of a file.






          share|improve this answer






















          • Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
            – OmiPenguin
            Dec 8 '12 at 14:33










          • @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
            – maxschlepzig
            Dec 8 '12 at 14:39










          • Ahh now i understand thanks dear for great explanation.
            – OmiPenguin
            Dec 8 '12 at 14:43










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f57961%2fwhy-ls-lrth-and-ls-ltch-gives-different-results%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          The differences between both commands are:



          • the 2nd listing is sorted in reverse (-r)

          • the 2nd listing uses the modification time stamp as sort key (-t)

          • the 1st listing uses the ctime stamp as sort key (-tc)

          On UNIX a file has 3 time stamps (atime, ctime, mtime) which are updated under different conditions.



          To quote the wikipedia article on stat:




          atime: time of last access (ls -lu),
          mtime: time of last modification (ls -l), and
          ctime: time of last status change (ls -lc).




          An example for a status change is changing the permissions of a file.






          share|improve this answer






















          • Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
            – OmiPenguin
            Dec 8 '12 at 14:33










          • @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
            – maxschlepzig
            Dec 8 '12 at 14:39










          • Ahh now i understand thanks dear for great explanation.
            – OmiPenguin
            Dec 8 '12 at 14:43














          up vote
          3
          down vote



          accepted










          The differences between both commands are:



          • the 2nd listing is sorted in reverse (-r)

          • the 2nd listing uses the modification time stamp as sort key (-t)

          • the 1st listing uses the ctime stamp as sort key (-tc)

          On UNIX a file has 3 time stamps (atime, ctime, mtime) which are updated under different conditions.



          To quote the wikipedia article on stat:




          atime: time of last access (ls -lu),
          mtime: time of last modification (ls -l), and
          ctime: time of last status change (ls -lc).




          An example for a status change is changing the permissions of a file.






          share|improve this answer






















          • Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
            – OmiPenguin
            Dec 8 '12 at 14:33










          • @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
            – maxschlepzig
            Dec 8 '12 at 14:39










          • Ahh now i understand thanks dear for great explanation.
            – OmiPenguin
            Dec 8 '12 at 14:43












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          The differences between both commands are:



          • the 2nd listing is sorted in reverse (-r)

          • the 2nd listing uses the modification time stamp as sort key (-t)

          • the 1st listing uses the ctime stamp as sort key (-tc)

          On UNIX a file has 3 time stamps (atime, ctime, mtime) which are updated under different conditions.



          To quote the wikipedia article on stat:




          atime: time of last access (ls -lu),
          mtime: time of last modification (ls -l), and
          ctime: time of last status change (ls -lc).




          An example for a status change is changing the permissions of a file.






          share|improve this answer














          The differences between both commands are:



          • the 2nd listing is sorted in reverse (-r)

          • the 2nd listing uses the modification time stamp as sort key (-t)

          • the 1st listing uses the ctime stamp as sort key (-tc)

          On UNIX a file has 3 time stamps (atime, ctime, mtime) which are updated under different conditions.



          To quote the wikipedia article on stat:




          atime: time of last access (ls -lu),
          mtime: time of last modification (ls -l), and
          ctime: time of last status change (ls -lc).




          An example for a status change is changing the permissions of a file.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 8 '12 at 14:36

























          answered Dec 8 '12 at 14:25









          maxschlepzig

          32.4k31135205




          32.4k31135205











          • Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
            – OmiPenguin
            Dec 8 '12 at 14:33










          • @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
            – maxschlepzig
            Dec 8 '12 at 14:39










          • Ahh now i understand thanks dear for great explanation.
            – OmiPenguin
            Dec 8 '12 at 14:43
















          • Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
            – OmiPenguin
            Dec 8 '12 at 14:33










          • @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
            – maxschlepzig
            Dec 8 '12 at 14:39










          • Ahh now i understand thanks dear for great explanation.
            – OmiPenguin
            Dec 8 '12 at 14:43















          Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
          – OmiPenguin
          Dec 8 '12 at 14:33




          Partially understood. But one thing is bothering me the timestamp of First line of First Listing and the Last Line of 2nd Listing is different and all other entries and same time in both listing. And I updated the Question Synchronized the commands based on Output. 2nd listing dont have the -tc flag
          – OmiPenguin
          Dec 8 '12 at 14:33












          @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
          – maxschlepzig
          Dec 8 '12 at 14:39




          @UmairMustafa, updated the answer. Well, some event happened that triggered the ctime update. And that event only happened on ctrl_071223 (I gave an example of such an event in the answer and referenced the section in the Wikipedia article that discusses the semantics of the ctime stamp).
          – maxschlepzig
          Dec 8 '12 at 14:39












          Ahh now i understand thanks dear for great explanation.
          – OmiPenguin
          Dec 8 '12 at 14:43




          Ahh now i understand thanks dear for great explanation.
          – OmiPenguin
          Dec 8 '12 at 14:43

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f57961%2fwhy-ls-lrth-and-ls-ltch-gives-different-results%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)