Why ls -lrth and ls -ltch gives different results

Clash 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
ls timestamps
add a comment |Â
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
ls timestamps
add a comment |Â
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
ls timestamps
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
ls timestamps
edited Dec 8 '12 at 23:35
Gilles
512k12010151547
512k12010151547
asked Dec 8 '12 at 14:19
OmiPenguin
1,485235784
1,485235784
add a comment |Â
add a comment |Â
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.
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 onctrl_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
add a comment |Â
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.
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 onctrl_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
add a comment |Â
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.
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 onctrl_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
add a comment |Â
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.
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.
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 onctrl_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
add a comment |Â
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 onctrl_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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password